public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Commit
[Web] update directorytree/ldaprecord
d479d185
data/web/inc/lib/composer.json | 2 +-
data/web/inc/lib/composer.lock | 340 +++--
data/web/inc/lib/vendor/autoload.php | 17 +-
data/web/inc/lib/vendor/bin/carbon | 46 +-
data/web/inc/lib/vendor/bin/var-dump-server | 46 +-
.../vendor/carbonphp/carbon-doctrine-types/LICENSE | 21 +
.../carbonphp/carbon-doctrine-types/README.md | 14 +
.../carbonphp/carbon-doctrine-types/composer.json | 36 +
.../src/Carbon/Doctrine/CarbonDoctrineType.php | 16 +
.../src/Carbon/Doctrine/CarbonImmutableType.php | 9 +
.../src/Carbon/Doctrine/CarbonType.php | 9 +
.../src/Carbon/Doctrine/CarbonTypeConverter.php | 92 +-
.../Carbon/Doctrine/DateTimeDefaultPrecision.php | 9 +-
.../src/Carbon/Doctrine/DateTimeImmutableType.php | 16 +-
.../src/Carbon/Doctrine/DateTimeType.php | 24 +
data/web/inc/lib/vendor/composer/ClassLoader.php | 137 +-
.../inc/lib/vendor/composer/InstalledVersions.php | 17 +-
.../inc/lib/vendor/composer/autoload_classmap.php | 1 +
.../web/inc/lib/vendor/composer/autoload_files.php | 4 +-
data/web/inc/lib/vendor/composer/autoload_psr4.php | 2 +
data/web/inc/lib/vendor/composer/autoload_real.php | 27 +-
.../inc/lib/vendor/composer/autoload_static.php | 15 +-
data/web/inc/lib/vendor/composer/installed.json | 364 ++++--
data/web/inc/lib/vendor/composer/installed.php | 88 +-
.../.github/ISSUE_TEMPLATE/bug_report.md | 5 +-
.../ISSUE_TEMPLATE/support---help-request.md | 5 +-
.../.github/workflows/run-integration-tests.yml | 62 +
.../ldaprecord/.github/workflows/run-tests.yml | 47 +-
.../vendor/directorytree/ldaprecord/.styleci.yml | 7 -
.../vendor/directorytree/ldaprecord/composer.json | 7 +-
.../directorytree/ldaprecord/docker-compose.yml | 35 +
.../vendor/directorytree/ldaprecord/phpunit.xml | 7 +-
.../lib/vendor/directorytree/ldaprecord/psalm.xml | 15 -
.../lib/vendor/directorytree/ldaprecord/readme.md | 4 +-
.../ldaprecord/src/Auth/Events/Event.php | 6 +-
.../directorytree/ldaprecord/src/Auth/Guard.php | 43 +-
.../src/Configuration/DomainConfiguration.php | 22 +-
.../src/Configuration/Validators/Validator.php | 4 +-
.../directorytree/ldaprecord/src/Connection.php | 79 +-
.../ldaprecord/src/ConnectionManager.php | 28 +-
.../directorytree/ldaprecord/src/Container.php | 13 +-
.../directorytree/ldaprecord/src/DetailedError.php | 6 +-
.../directorytree/ldaprecord/src/DetectsErrors.php | 19 +-
.../directorytree/ldaprecord/src/EscapesValues.php | 7 +-
.../ldaprecord/src/Events/ConnectionEvent.php | 2 +-
.../ldaprecord/src/Events/Dispatcher.php | 45 +-
.../ldaprecord/src/Events/DispatcherInterface.php | 33 +-
.../directorytree/ldaprecord/src/Events/Logger.php | 17 +-
.../ldaprecord/src/Events/NullDispatcher.php | 35 +-
.../ldaprecord/src/HandlesConnection.php | 19 +-
.../vendor/directorytree/ldaprecord/src/Ldap.php | 33 +-
.../directorytree/ldaprecord/src/LdapInterface.php | 202 ++-
.../ldaprecord/src/LdapRecordException.php | 8 +-
.../ActiveDirectory/Concerns/HasPrimaryGroup.php | 7 +-
.../src/Models/ActiveDirectory/Entry.php | 102 +-
.../Relations/HasOnePrimaryGroup.php | 6 +-
.../Scopes/HasServerRoleAttribute.php | 5 +-
.../Scopes/InConfigurationContext.php | 8 +-
.../Scopes/RejectComputerObjectClass.php | 5 +-
.../ldaprecord/src/Models/ActiveDirectory/User.php | 44 +-
.../src/Models/Attributes/AccountControl.php | 67 +-
.../src/Models/Attributes/DistinguishedName.php | 52 +-
.../Models/Attributes/DistinguishedNameBuilder.php | 46 +-
.../src/Models/Attributes/EscapedValue.php | 9 +-
.../ldaprecord/src/Models/Attributes/Guid.php | 15 +-
.../ldaprecord/src/Models/Attributes/MbString.php | 12 +-
.../ldaprecord/src/Models/Attributes/Password.php | 106 +-
.../ldaprecord/src/Models/Attributes/Sid.php | 8 +-
.../src/Models/Attributes/TSProperty.php | 56 +-
.../src/Models/Attributes/TSPropertyArray.php | 38 +-
.../ldaprecord/src/Models/Attributes/Timestamp.php | 59 +-
.../ldaprecord/src/Models/BatchModification.php | 32 +-
.../ldaprecord/src/Models/Collection.php | 37 +-
.../src/Models/Concerns/CanAuthenticate.php | 6 +-
.../src/Models/Concerns/HasAttributes.php | 276 ++--
.../ldaprecord/src/Models/Concerns/HasEvents.php | 44 +-
.../src/Models/Concerns/HasGlobalScopes.php | 12 +-
.../ldaprecord/src/Models/Concerns/HasPassword.php | 27 +-
.../src/Models/Concerns/HasRelationships.php | 45 +-
.../ldaprecord/src/Models/Concerns/HasScopes.php | 1 +
.../src/Models/Concerns/HidesAttributes.php | 20 +-
.../SerializesAndRestoresPropertyValues.php | 47 +
.../src/Models/Concerns/SerializesProperties.php | 143 ++
.../ldaprecord/src/Models/DetectsResetIntegers.php | 3 +-
.../src/Models/DirectoryServer/Entry.php | 3 +-
.../ldaprecord/src/Models/Events/Event.php | 2 +-
.../ldaprecord/src/Models/Events/Renaming.php | 6 +-
.../ldaprecord/src/Models/FreeIPA/Entry.php | 3 +-
.../FreeIPA/Scopes/AddEntryUuidToSelects.php | 5 +-
.../directorytree/ldaprecord/src/Models/Model.php | 405 +++---
.../src/Models/ModelDoesNotExistException.php | 6 +-
.../ldaprecord/src/Models/OpenLDAP/Entry.php | 3 +-
.../ldaprecord/src/Models/OpenLDAP/Group.php | 12 +
.../OpenLDAP/Scopes/AddEntryUuidToSelects.php | 5 +-
.../ldaprecord/src/Models/OpenLDAP/User.php | 2 +-
.../ldaprecord/src/Models/Relations/HasMany.php | 144 ++-
.../ldaprecord/src/Models/Relations/HasOne.php | 3 +-
.../ldaprecord/src/Models/Relations/OneToMany.php | 33 +-
.../ldaprecord/src/Models/Relations/Relation.php | 157 ++-
.../directorytree/ldaprecord/src/Models/Scope.php | 5 +-
.../src/Models/Types/ActiveDirectory.php | 11 +-
.../src/Models/Types/DirectoryServer.php | 8 +
.../ldaprecord/src/Query/ArrayCacheStore.php | 6 +-
.../directorytree/ldaprecord/src/Query/Builder.php | 540 ++++----
.../directorytree/ldaprecord/src/Query/Cache.php | 22 +-
.../ldaprecord/src/Query/Events/QueryExecuted.php | 4 +-
.../ldaprecord/src/Query/Filter/ConditionNode.php | 100 ++
.../ldaprecord/src/Query/Filter/GroupNode.php | 54 +
.../ldaprecord/src/Query/Filter/Node.php | 30 +
.../ldaprecord/src/Query/Filter/Parser.php | 162 +++
.../src/Query/Filter/ParserException.php | 9 +
.../directorytree/ldaprecord/src/Query/Grammar.php | 129 +-
.../ldaprecord/src/Query/InteractsWithTime.php | 9 +-
.../src/Query/Model/ActiveDirectoryBuilder.php | 70 +-
.../ldaprecord/src/Query/Model/Builder.php | 70 +-
.../src/Query/ObjectNotFoundException.php | 10 +-
.../src/Query/Pagination/AbstractPaginator.php | 16 +-
.../src/Query/Pagination/LazyPaginator.php | 3 +-
.../directorytree/ldaprecord/src/Query/Slice.php | 283 ++++
.../directorytree/ldaprecord/src/Support/Arr.php | 34 +-
.../ldaprecord/src/Support/Helpers.php | 8 +-
.../directorytree/ldaprecord/src/Support/Str.php | 129 ++
.../ldaprecord/src/Testing/ConnectionFake.php | 8 +-
.../ldaprecord/src/Testing/DirectoryFake.php | 6 +-
.../ldaprecord/src/Testing/LdapExpectation.php | 35 +-
.../ldaprecord/src/Testing/LdapFake.php | 54 +-
.../directorytree/ldaprecord/src/Utilities.php | 37 +-
.../illuminate/contracts/Auth/Access/Gate.php | 8 +-
.../contracts/Broadcasting/ShouldBeUnique.php | 8 +
.../illuminate/contracts/Cache/Repository.php | 28 +-
.../illuminate/contracts/Console/Isolatable.php | 8 +
.../contracts/Console/PromptsForMissingInput.php | 8 +
.../illuminate/contracts/Container/Container.php | 9 +
.../Container/ContextualBindingBuilder.php | 2 +-
.../contracts/Cookie/QueueingFactory.php | 2 +-
.../contracts/Database/Eloquent/Castable.php | 3 +-
.../Database/Eloquent/CastsAttributes.php | 18 +-
.../Database/Eloquent/CastsInboundAttributes.php | 4 +-
.../Eloquent/SerializesCastableAttributes.php | 4 +-
.../contracts/Database/ModelIdentifier.php | 20 +
.../Database/Query/ConditionExpression.php | 7 +
.../contracts/Database/Query/Expression.php | 16 +
.../illuminate/contracts/Events/Dispatcher.php | 2 +-
.../contracts/Events/ShouldDispatchAfterCommit.php | 8 +
.../Events/ShouldHandleEventsAfterCommit.php | 8 +
.../illuminate/contracts/Filesystem/Filesystem.php | 2 +-
.../contracts/Foundation/Application.php | 25 +-
.../illuminate/contracts/Mail/Attachable.php | 13 +
.../vendor/illuminate/contracts/Mail/Mailable.php | 2 +-
.../vendor/illuminate/contracts/Mail/Mailer.php | 4 +-
.../contracts/Pagination/CursorPaginator.php | 7 +
.../illuminate/contracts/Pagination/Paginator.php | 8 +-
.../contracts/Process/InvokedProcess.php | 64 +
.../illuminate/contracts/Process/ProcessResult.php | 65 +
.../vendor/illuminate/contracts/Queue/Monitor.php | 2 +-
.../contracts/Queue/ShouldQueueAfterCommit.php | 8 +
.../contracts/Routing/ResponseFactory.php | 6 +-
.../Session/Middleware/AuthenticatesSessions.php | 8 +
.../illuminate/contracts/Support/MessageBag.php | 8 +
.../contracts/Translation/Translator.php | 2 +-
.../contracts/Validation/DataAwareRule.php | 2 +-
.../illuminate/contracts/Validation/Factory.php | 4 +-
.../contracts/Validation/ImplicitRule.php | 3 +
.../contracts/Validation/InvokableRule.php | 21 +
.../illuminate/contracts/Validation/Rule.php | 3 +
.../contracts/Validation/ValidationRule.php | 18 +
.../contracts/Validation/ValidatorAwareRule.php | 4 +-
.../contracts/View/ViewCompilationException.php | 10 +
.../lib/vendor/illuminate/contracts/composer.json | 4 +-
.../lib/vendor/nesbot/carbon/.phpstorm.meta.php | 10 +
.../web/inc/lib/vendor/nesbot/carbon/composer.json | 94 +-
.../MessageFormatterMapperStrongType.php | 28 +
.../MessageFormatterMapperWeakType.php | 36 +
.../lazy/Carbon/PHPStan/AbstractMacroBuiltin.php | 36 +
.../lazy/Carbon/PHPStan/AbstractMacroStatic.php | 45 +
.../carbon/lazy/Carbon/PHPStan/MacroStrongType.php | 6 +-
.../carbon/lazy/Carbon/PHPStan/MacroWeakType.php | 6 +-
data/web/inc/lib/vendor/nesbot/carbon/readme.md | 53 +-
data/web/inc/lib/vendor/nesbot/carbon/sponsors.php | 129 ++
.../carbon/src/Carbon/AbstractTranslator.php | 27 +-
.../lib/vendor/nesbot/carbon/src/Carbon/Carbon.php | 934 ++++++-------
.../nesbot/carbon/src/Carbon/CarbonImmutable.php | 958 +++++++-------
.../nesbot/carbon/src/Carbon/CarbonInterface.php | 113 +-
.../nesbot/carbon/src/Carbon/CarbonInterval.php | 443 +++++--
.../nesbot/carbon/src/Carbon/CarbonPeriod.php | 540 +++++---
.../carbon/src/Carbon/CarbonPeriodImmutable.php | 40 +
.../nesbot/carbon/src/Carbon/CarbonTimeZone.php | 38 +-
.../src/Carbon/Doctrine/CarbonDoctrineType.php | 23 -
.../src/Carbon/Doctrine/CarbonImmutableType.php | 37 -
.../carbon/src/Carbon/Doctrine/CarbonType.php | 37 -
.../carbon/src/Carbon/Doctrine/DateTimeType.php | 16 -
.../Exceptions/BadComparisonUnitException.php | 25 +-
.../Exceptions/BadFluentConstructorException.php | 25 +-
.../Carbon/Exceptions/BadFluentSetterException.php | 29 +-
.../Carbon/Exceptions/BadMethodCallException.php | 1 +
.../Carbon/Exceptions/EndLessPeriodException.php | 19 +
.../carbon/src/Carbon/Exceptions/Exception.php | 1 +
.../src/Carbon/Exceptions/ImmutableException.php | 24 +-
.../Carbon/Exceptions/InvalidArgumentException.php | 1 +
.../src/Carbon/Exceptions/InvalidCastException.php | 13 +-
.../src/Carbon/Exceptions/InvalidDateException.php | 6 +-
.../Carbon/Exceptions/InvalidFormatException.php | 13 +-
.../Carbon/Exceptions/InvalidIntervalException.php | 13 +-
.../Exceptions/InvalidPeriodDateException.php | 13 +-
.../Exceptions/InvalidPeriodParameterException.php | 13 +-
.../Carbon/Exceptions/InvalidTimeZoneException.php | 13 +-
.../src/Carbon/Exceptions/InvalidTypeException.php | 13 +-
.../Carbon/Exceptions/NotACarbonClassException.php | 31 +-
.../src/Carbon/Exceptions/NotAPeriodException.php | 13 +-
.../Carbon/Exceptions/NotLocaleAwareException.php | 6 +-
.../src/Carbon/Exceptions/OutOfRangeException.php | 6 +-
.../src/Carbon/Exceptions/ParseErrorException.php | 61 +-
.../src/Carbon/Exceptions/RuntimeException.php | 1 +
.../carbon/src/Carbon/Exceptions/UnitException.php | 13 +-
.../Exceptions/UnitNotConfiguredException.php | 25 +-
.../Carbon/Exceptions/UnknownGetterException.php | 29 +-
.../Carbon/Exceptions/UnknownMethodException.php | 25 +-
.../Carbon/Exceptions/UnknownSetterException.php | 29 +-
.../src/Carbon/Exceptions/UnknownUnitException.php | 25 +-
.../src/Carbon/Exceptions/UnreachableException.php | 13 +-
.../vendor/nesbot/carbon/src/Carbon/Factory.php | 8 +-
.../nesbot/carbon/src/Carbon/FactoryImmutable.php | 28 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php | 5 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/be.php | 7 +-
.../carbon/src/Carbon/Lang/ca_ES_Valencia.php | 10 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ckb.php | 89 ++
.../vendor/nesbot/carbon/src/Carbon/Lang/cs.php | 3 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/cy.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/da.php | 7 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/de.php | 9 +
.../vendor/nesbot/carbon/src/Carbon/Lang/en.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php | 8 +
.../vendor/nesbot/carbon/src/Carbon/Lang/es.php | 10 +
.../vendor/nesbot/carbon/src/Carbon/Lang/fi.php | 2 +
.../vendor/nesbot/carbon/src/Carbon/Lang/fr.php | 11 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/hu.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/it.php | 11 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/ku.php | 42 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/lv.php | 3 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/mn.php | 62 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/ms.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/oc.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/pl.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/pt.php | 9 +
.../vendor/nesbot/carbon/src/Carbon/Lang/sh.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/sk.php | 112 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/sl.php | 6 +-
.../nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php | 22 +-
.../nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php | 10 +
.../nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php | 31 +-
.../nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php | 10 +
.../nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php | 10 +
.../nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php | 10 +
.../nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php | 10 +
.../vendor/nesbot/carbon/src/Carbon/Lang/ss.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/sv.php | 2 +-
.../vendor/nesbot/carbon/src/Carbon/Lang/uk.php | 3 +-
.../carbon/src/Carbon/Laravel/ServiceProvider.php | 52 +-
.../MessageFormatter/MessageFormatterMapper.php | 44 +
.../carbon/src/Carbon/PHPStan/AbstractMacro.php | 102 +-
.../nesbot/carbon/src/Carbon/PHPStan/Macro.php | 7 +
.../carbon/src/Carbon/PHPStan/MacroExtension.php | 18 +-
.../carbon/src/Carbon/PHPStan/MacroScanner.php | 40 +-
.../nesbot/carbon/src/Carbon/Traits/Comparison.php | 93 +-
.../nesbot/carbon/src/Carbon/Traits/Converter.php | 64 +-
.../nesbot/carbon/src/Carbon/Traits/Creator.php | 80 +-
.../nesbot/carbon/src/Carbon/Traits/Date.php | 93 +-
.../nesbot/carbon/src/Carbon/Traits/Difference.php | 39 +-
.../carbon/src/Carbon/Traits/IntervalRounding.php | 2 +-
.../carbon/src/Carbon/Traits/Localization.php | 38 +-
.../carbon/src/Carbon/Traits/MagicParameter.php | 33 +
.../nesbot/carbon/src/Carbon/Traits/Mixin.php | 67 +-
.../nesbot/carbon/src/Carbon/Traits/Modifiers.php | 6 +-
.../nesbot/carbon/src/Carbon/Traits/Options.php | 8 +-
.../nesbot/carbon/src/Carbon/Traits/Rounding.php | 31 +-
.../carbon/src/Carbon/Traits/Serialization.php | 100 +-
.../nesbot/carbon/src/Carbon/Traits/Test.php | 32 +-
.../nesbot/carbon/src/Carbon/Traits/Timestamp.php | 6 +-
.../carbon/src/Carbon/Traits/ToStringFormat.php | 56 +
.../nesbot/carbon/src/Carbon/Traits/Units.php | 36 +-
.../carbon/src/Carbon/TranslatorImmutable.php | 2 +-
data/web/inc/lib/vendor/psr/clock/CHANGELOG.md | 11 +
data/web/inc/lib/vendor/psr/clock/LICENSE | 19 +
data/web/inc/lib/vendor/psr/clock/README.md | 61 +
data/web/inc/lib/vendor/psr/clock/composer.json | 21 +
.../lib/vendor/psr/clock/src/ClockInterface.php | 13 +
.../symfony/deprecation-contracts/composer.json | 2 +-
.../lib/vendor/symfony/polyfill-mbstring/LICENSE | 2 +-
.../vendor/symfony/polyfill-mbstring/Mbstring.php | 148 ++-
.../lib/vendor/symfony/polyfill-mbstring/README.md | 2 +-
.../Resources/unidata/caseFolding.php | 119 ++
.../vendor/symfony/polyfill-mbstring/bootstrap.php | 4 +
.../symfony/polyfill-mbstring/bootstrap80.php | 4 +
.../vendor/symfony/polyfill-mbstring/composer.json | 3 -
.../inc/lib/vendor/symfony/polyfill-php80/LICENSE | 2 +-
.../lib/vendor/symfony/polyfill-php80/Php80.php | 12 +-
.../lib/vendor/symfony/polyfill-php80/PhpToken.php | 103 ++
.../lib/vendor/symfony/polyfill-php80/README.md | 7 +-
.../polyfill-php80/Resources/stubs/Attribute.php | 9 +
.../polyfill-php80/Resources/stubs/PhpToken.php | 16 +
.../polyfill-php80/Resources/stubs/Stringable.php | 9 +
.../Resources/stubs/UnhandledMatchError.php | 9 +
.../polyfill-php80/Resources/stubs/ValueError.php | 9 +
.../vendor/symfony/polyfill-php80/composer.json | 3 -
.../symfony/translation-contracts/.gitignore | 3 -
.../vendor/symfony/translation-contracts/LICENSE | 2 +-
.../translation-contracts/LocaleAwareInterface.php | 2 +
.../vendor/symfony/translation-contracts/README.md | 2 +-
.../translation-contracts/Test/TranslatorTest.php | 31 +-
.../translation-contracts/TranslatorTrait.php | 211 ++-
.../symfony/translation-contracts/composer.json | 12 +-
.../lib/vendor/symfony/translation/CHANGELOG.md | 29 +
.../translation/Catalogue/AbstractOperation.php | 38 +-
.../translation/Catalogue/MergeOperation.php | 14 +-
.../translation/Catalogue/TargetOperation.php | 14 +-
.../CatalogueMetadataAwareInterface.php | 48 +
.../translation/Command/TranslationPullCommand.php | 27 +-
.../translation/Command/TranslationPushCommand.php | 21 +-
.../translation/Command/XliffLintCommand.php | 71 +-
.../DataCollector/TranslationDataCollector.php | 30 +-
.../translation/DataCollectorTranslator.php | 37 +-
.../DataCollectorTranslatorPass.php | 36 +
.../DependencyInjection/LoggingTranslatorPass.php | 59 +
.../DependencyInjection/TranslationDumperPass.php | 3 +
.../TranslationExtractorPass.php | 3 +
.../DependencyInjection/TranslatorPass.php | 20 +
.../DependencyInjection/TranslatorPathsPass.php | 34 +-
.../symfony/translation/Dumper/CsvFileDumper.php | 8 +-
.../symfony/translation/Dumper/DumperInterface.php | 2 +
.../symfony/translation/Dumper/FileDumper.php | 4 +-
.../translation/Dumper/IcuResFileDumper.php | 15 +-
.../symfony/translation/Dumper/IniFileDumper.php | 6 -
.../symfony/translation/Dumper/JsonFileDumper.php | 6 -
.../symfony/translation/Dumper/MoFileDumper.php | 10 +-
.../symfony/translation/Dumper/PhpFileDumper.php | 6 -
.../symfony/translation/Dumper/PoFileDumper.php | 8 +-
.../symfony/translation/Dumper/QtFileDumper.php | 6 -
.../symfony/translation/Dumper/XliffFileDumper.php | 38 +-
.../symfony/translation/Dumper/YamlFileDumper.php | 6 -
.../Exception/IncompleteDsnException.php | 2 +-
.../Exception/MissingRequiredOptionException.php | 2 +-
.../translation/Exception/ProviderException.php | 4 +-
.../Exception/UnsupportedSchemeException.php | 8 +-
.../translation/Extractor/ChainExtractor.php | 6 +-
.../translation/Extractor/ExtractorInterface.php | 4 +
.../translation/Extractor/PhpAstExtractor.php | 85 ++
.../symfony/translation/Extractor/PhpExtractor.php | 19 +-
.../translation/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 +-
.../translation/Formatter/MessageFormatter.php | 18 +-
.../web/inc/lib/vendor/symfony/translation/LICENSE | 2 +-
.../symfony/translation/Loader/ArrayLoader.php | 9 +-
.../symfony/translation/Loader/CsvFileLoader.php | 7 +-
.../symfony/translation/Loader/FileLoader.php | 7 +-
.../translation/Loader/IcuDatFileLoader.php | 5 +-
.../translation/Loader/IcuResFileLoader.php | 9 +-
.../symfony/translation/Loader/IniFileLoader.php | 3 -
.../symfony/translation/Loader/JsonFileLoader.php | 25 +-
.../symfony/translation/Loader/MoFileLoader.php | 2 -
.../symfony/translation/Loader/PhpFileLoader.php | 11 +-
.../symfony/translation/Loader/PoFileLoader.php | 14 +-
.../symfony/translation/Loader/QtFileLoader.php | 4 -
.../symfony/translation/Loader/XliffFileLoader.php | 23 +-
.../symfony/translation/Loader/YamlFileLoader.php | 7 +-
.../vendor/symfony/translation/LocaleSwitcher.php | 78 ++
.../symfony/translation/LoggingTranslator.php | 30 +-
.../symfony/translation/MessageCatalogue.php | 126 +-
.../translation/MessageCatalogueInterface.php | 16 +-
.../symfony/translation/MetadataAwareInterface.php | 6 +-
.../Provider/AbstractProviderFactory.php | 12 +-
.../vendor/symfony/translation/Provider/Dsn.php | 34 +-
.../translation/Provider/FilteringProvider.php | 5 +-
.../translation/Provider/ProviderInterface.php | 4 +-
.../Provider/TranslationProviderCollection.php | 2 +-
.../translation/PseudoLocalizationTranslator.php | 11 +-
.../inc/lib/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 | 4 +
.../symfony/translation/Resources/functions.php | 2 +-
...-strict.xsd => xliff-core-1.2-transitional.xsd} | 84 +-
.../translation/Test/ProviderFactoryTestCase.php | 32 +-
.../symfony/translation/Test/ProviderTestCase.php | 24 +-
.../symfony/translation/TranslatableMessage.php | 8 +-
.../lib/vendor/symfony/translation/Translator.php | 63 +-
.../vendor/symfony/translation/TranslatorBag.php | 15 +-
.../symfony/translation/TranslatorBagInterface.php | 2 +-
.../symfony/translation/Util/ArrayConverter.php | 51 +-
.../vendor/symfony/translation/Util/XliffUtils.php | 2 +-
.../translation/Writer/TranslationWriter.php | 4 +
.../Writer/TranslationWriterInterface.php | 2 +
.../lib/vendor/symfony/translation/composer.json | 32 +-
.../inc/lib/vendor/symfony/var-dumper/CHANGELOG.md | 19 +
.../symfony/var-dumper/Caster/AmqpCaster.php | 15 +
.../vendor/symfony/var-dumper/Caster/ArgsStub.php | 4 +-
.../vendor/symfony/var-dumper/Caster/Caster.php | 50 +-
.../vendor/symfony/var-dumper/Caster/ClassStub.php | 13 +-
.../vendor/symfony/var-dumper/Caster/ConstStub.php | 2 +-
.../vendor/symfony/var-dumper/Caster/CutStub.php | 2 +-
.../vendor/symfony/var-dumper/Caster/DOMCaster.php | 82 +-
.../symfony/var-dumper/Caster/DateCaster.php | 24 +-
.../symfony/var-dumper/Caster/DoctrineCaster.php | 9 +
.../symfony/var-dumper/Caster/DsPairStub.php | 2 +-
.../symfony/var-dumper/Caster/ExceptionCaster.php | 47 +-
.../vendor/symfony/var-dumper/Caster/FFICaster.php | 161 +++
.../symfony/var-dumper/Caster/FiberCaster.php | 3 +
.../symfony/var-dumper/Caster/IntlCaster.php | 17 +-
.../vendor/symfony/var-dumper/Caster/LinkStub.php | 9 +-
.../symfony/var-dumper/Caster/MemcachedCaster.php | 9 +-
.../vendor/symfony/var-dumper/Caster/PdoCaster.php | 8 +-
.../symfony/var-dumper/Caster/PgSqlCaster.php | 9 +
.../var-dumper/Caster/ProxyManagerCaster.php | 3 +
.../symfony/var-dumper/Caster/RdKafkaCaster.php | 40 +-
.../symfony/var-dumper/Caster/RedisCaster.php | 32 +-
.../symfony/var-dumper/Caster/ReflectionCaster.php | 61 +-
.../symfony/var-dumper/Caster/ResourceCaster.php | 28 +-
.../symfony/var-dumper/Caster/ScalarStub.php | 27 +
.../vendor/symfony/var-dumper/Caster/SplCaster.php | 62 +-
.../symfony/var-dumper/Caster/StubCaster.php | 23 +
.../symfony/var-dumper/Caster/SymfonyCaster.php | 50 +-
.../vendor/symfony/var-dumper/Caster/TraceStub.php | 2 +-
.../var-dumper/Caster/UninitializedStub.php | 25 +
.../symfony/var-dumper/Caster/XmlReaderCaster.php | 7 +-
.../var-dumper/Caster/XmlResourceCaster.php | 3 +
.../symfony/var-dumper/Cloner/AbstractCloner.php | 27 +-
.../lib/vendor/symfony/var-dumper/Cloner/Data.php | 34 +-
.../symfony/var-dumper/Cloner/DumperInterface.php | 8 +
.../lib/vendor/symfony/var-dumper/Cloner/Stub.php | 1 +
.../vendor/symfony/var-dumper/Cloner/VarCloner.php | 49 +-
.../Command/Descriptor/CliDescriptor.php | 2 +-
.../Command/Descriptor/HtmlDescriptor.php | 2 +-
.../var-dumper/Command/ServerDumpCommand.php | 4 +-
.../symfony/var-dumper/Dumper/AbstractDumper.php | 24 +-
.../vendor/symfony/var-dumper/Dumper/CliDumper.php | 102 +-
.../ContextProvider/RequestContextProvider.php | 4 +-
.../ContextProvider/SourceContextProvider.php | 9 +-
.../var-dumper/Dumper/ContextualizedDumper.php | 11 +-
.../var-dumper/Dumper/DataDumperInterface.php | 3 +
.../symfony/var-dumper/Dumper/HtmlDumper.php | 96 +-
.../symfony/var-dumper/Dumper/ServerDumper.php | 12 +-
.../Exception/ThrowingCasterException.php | 2 +-
data/web/inc/lib/vendor/symfony/var-dumper/LICENSE | 2 +-
.../var-dumper/Resources/bin/var-dump-server | 4 +
.../var-dumper/Resources/functions/dump.php | 40 +-
.../symfony/var-dumper/Server/Connection.php | 14 +-
.../symfony/var-dumper/Server/DumpServer.php | 16 +-
.../symfony/var-dumper/Test/VarDumperTestTrait.php | 4 +-
.../lib/vendor/symfony/var-dumper/VarDumper.php | 33 +-
.../lib/vendor/symfony/var-dumper/composer.json | 17 +-
.../collect/.github/workflows/run-tests.yml | 4 +-
.../inc/lib/vendor/tightenco/collect/composer.json | 3 +-
.../lib/vendor/tightenco/collect/framework-.zip | 0
.../Collect/Conditionable/HigherOrderWhenProxy.php | 109 ++
.../src/Collect/Contracts/Support/Arrayable.php | 6 +-
.../tightenco/collect/src/Collect/Support/Arr.php | 133 +-
.../collect/src/Collect/Support/Collection.php | 429 +++---
.../collect/src/Collect/Support/Enumerable.php | 526 +++++---
.../src/Collect/Support/HigherOrderWhenProxy.php | 63 -
.../collect/src/Collect/Support/LazyCollection.php | 375 ++++--
.../tightenco/collect/src/Collect/Support/Str.php | 1367 ++++++++++++++++++++
.../src/Collect/Support/Traits/Conditionable.php | 73 ++
.../Collect/Support/Traits/EnumeratesValues.php | 428 +++---
.../collect/src/Collect/Support/alias.php | 1 -
481 files changed, 13914 insertions(+), 6166 deletions(-)
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/LICENSE
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/README.md
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/composer.json
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php
rename data/web/inc/lib/vendor/{nesbot/carbon => carbonphp/carbon-doctrine-types}/src/Carbon/Doctrine/CarbonTypeConverter.php (59%)
rename data/web/inc/lib/vendor/{nesbot/carbon => carbonphp/carbon-doctrine-types}/src/Carbon/Doctrine/DateTimeDefaultPrecision.php (70%)
rename data/web/inc/lib/vendor/{nesbot/carbon => carbonphp/carbon-doctrine-types}/src/Carbon/Doctrine/DateTimeImmutableType.php (58%)
create mode 100644 data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-integration-tests.yml
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/docker-compose.yml
delete mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/psalm.xml
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesAndRestoresPropertyValues.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesProperties.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/DirectoryServer.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ConditionNode.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/GroupNode.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Node.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Parser.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ParserException.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Slice.php
create mode 100644 data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Str.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBeUnique.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Console/Isolatable.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Console/PromptsForMissingInput.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Database/Query/ConditionExpression.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Expression.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldDispatchAfterCommit.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldHandleEventsAfterCommit.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Mail/Attachable.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Process/InvokedProcess.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Process/ProcessResult.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Queue/ShouldQueueAfterCommit.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Validation/InvokableRule.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidationRule.php
create mode 100644 data/web/inc/lib/vendor/illuminate/contracts/View/ViewCompilationException.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/.phpstorm.meta.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/sponsors.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php
delete mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php
delete mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php
delete mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php
delete mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php
create mode 100644 data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php
create mode 100644 data/web/inc/lib/vendor/psr/clock/CHANGELOG.md
create mode 100644 data/web/inc/lib/vendor/psr/clock/LICENSE
create mode 100644 data/web/inc/lib/vendor/psr/clock/README.md
create mode 100644 data/web/inc/lib/vendor/psr/clock/composer.json
create mode 100644 data/web/inc/lib/vendor/psr/clock/src/ClockInterface.php
create mode 100644 data/web/inc/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php
create mode 100644 data/web/inc/lib/vendor/symfony/polyfill-php80/PhpToken.php
create mode 100644 data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
delete mode 100644 data/web/inc/lib/vendor/symfony/translation-contracts/.gitignore
create mode 100644 data/web/inc/lib/vendor/symfony/translation/CatalogueMetadataAwareInterface.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/Extractor/PhpAstExtractor.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php
create mode 100644 data/web/inc/lib/vendor/symfony/translation/LocaleSwitcher.php
rename data/web/inc/lib/vendor/symfony/translation/Resources/schemas/{xliff-core-1.2-strict.xsd => xliff-core-1.2-transitional.xsd} (96%)
create mode 100644 data/web/inc/lib/vendor/symfony/var-dumper/Caster/FFICaster.php
create mode 100644 data/web/inc/lib/vendor/symfony/var-dumper/Caster/ScalarStub.php
create mode 100644 data/web/inc/lib/vendor/symfony/var-dumper/Caster/UninitializedStub.php
create mode 100644 data/web/inc/lib/vendor/tightenco/collect/framework-.zip
create mode 100644 data/web/inc/lib/vendor/tightenco/collect/src/Collect/Conditionable/HigherOrderWhenProxy.php
delete mode 100644 data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php
create mode 100644 data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Str.php
create mode 100644 data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Conditionable.php
Diff
diff --git a/data/web/inc/lib/composer.json b/data/web/inc/lib/composer.json
index a803291f..91a50bcb 100644
--- a/data/web/inc/lib/composer.json
+++ b/data/web/inc/lib/composer.json
@@ -8,7 +8,7 @@
"matthiasmullie/minify": "^1.3",
"bshaffer/oauth2-server-php": "^1.11",
"mustangostang/spyc": "^0.6.3",
- "directorytree/ldaprecord": "^2.4",
+ "directorytree/ldaprecord": "^3.3",
"twig/twig": "^3.0",
"stevenmaguire/oauth2-keycloak": "^4.0",
"league/oauth2-client": "^2.7"
diff --git a/data/web/inc/lib/composer.lock b/data/web/inc/lib/composer.lock
index 516e9fec..f0659ee8 100644
--- a/data/web/inc/lib/composer.lock
+++ b/data/web/inc/lib/composer.lock
@@ -68,6 +68,75 @@
},
"time": "2018-12-04T00:29:32+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": "[email protected]"
+ }
+ ],
+ "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": "ddeboer/imap",
"version": "1.13.1",
@@ -145,27 +214,28 @@
},
{
"name": "directorytree/ldaprecord",
- "version": "v2.10.1",
+ "version": "v2.20.5",
"source": {
"type": "git",
"url": "https://github.com/DirectoryTree/LdapRecord.git",
- "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88"
+ "reference": "5bd0a5a9d257cf1049ae83055dbba4c3479ddf16"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/bf512d9af7a7b0e2ed7a666ab29cefdd027bee88",
- "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88",
+ "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/5bd0a5a9d257cf1049ae83055dbba4c3479ddf16",
+ "reference": "5bd0a5a9d257cf1049ae83055dbba4c3479ddf16",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-ldap": "*",
- "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0",
+ "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"nesbot/carbon": "^1.0|^2.0",
"php": ">=7.3",
- "psr/log": "*",
+ "psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0",
- "tightenco/collect": "^5.6|^6.0|^7.0|^8.0"
+ "symfony/polyfill-php80": "^1.25",
+ "tightenco/collect": "^5.6|^6.0|^7.0|^8.0|^9.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
@@ -214,7 +284,7 @@
"type": "github"
}
],
- "time": "2022-02-25T16:00:51+00:00"
+ "time": "2023-10-11T16:34:34+00:00"
},
{
"name": "firebase/php-jwt",
@@ -609,27 +679,27 @@
},
{
"name": "illuminate/contracts",
- "version": "v9.3.0",
+ "version": "v10.44.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/contracts.git",
- "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0"
+ "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/illuminate/contracts/zipball/bf4b3c254c49d28157645d01e4883b5951b1e1d0",
- "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0",
+ "url": "https://api.github.com/repos/illuminate/contracts/zipball/8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac",
+ "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac",
"shasum": ""
},
"require": {
- "php": "^8.0.2",
+ "php": "^8.1",
"psr/container": "^1.1.1|^2.0.1",
"psr/simple-cache": "^1.0|^2.0|^3.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.x-dev"
+ "dev-master": "10.x-dev"
}
},
"autoload": {
@@ -653,7 +723,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2022-02-22T14:45:39+00:00"
+ "time": "2024-01-15T18:52:32+00:00"
},
{
"name": "league/oauth2-client",
@@ -908,34 +978,41 @@
},
{
"name": "nesbot/carbon",
- "version": "2.57.0",
+ "version": "2.72.3",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "4a54375c21eea4811dbd1149fe6b246517554e78"
+ "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78",
- "reference": "4a54375c21eea4811dbd1149fe6b246517554e78",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0c6fd108360c562f6e4fd1dedb8233b423e91c83",
+ "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83",
"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.0",
- "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": "*",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^0.12.54 || ^1.0",
- "phpunit/phpunit": "^7.5.20 || ^8.5.14",
+ "phpstan/phpstan": "^0.12.99 || ^1.7.14",
+ "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20",
"squizlabs/php_codesniffer": "^3.4"
},
"bin": [
@@ -992,15 +1069,19 @@
},
"funding": [
{
- "url": "https://opencollective.com/Carbon",
- "type": "open_collective"
+ "url": "https://github.com/sponsors/kylekatarnls",
+ "type": "github"
},
{
- "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
+ "url": "https://opencollective.com/Carbon#sponsor",
+ "type": "opencollective"
+ },
+ {
+ "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme",
"type": "tidelift"
}
],
- "time": "2022-02-13T18:13:33+00:00"
+ "time": "2024-01-25T10:35:09+00:00"
},
{
"name": "paragonie/random_compat",
@@ -1221,6 +1302,54 @@
],
"time": "2022-02-28T15:31:21+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": "2.0.2",
@@ -1767,16 +1896,16 @@
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.2.1",
+ "version": "v3.4.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e"
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e",
- "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
"shasum": ""
},
"require": {
@@ -1785,7 +1914,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.3-dev"
+ "dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -1814,7 +1943,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.2.1"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
},
"funding": [
{
@@ -1830,7 +1959,7 @@
"type": "tidelift"
}
],
- "time": "2023-03-01T10:25:55+00:00"
+ "time": "2023-05-23T14:45:45+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -1916,16 +2045,16 @@
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.24.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"shasum": ""
},
"require": {
@@ -1939,9 +2068,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -1979,7 +2105,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
},
"funding": [
{
@@ -1995,20 +2121,20 @@
"type": "tidelift"
}
],
- "time": "2021-11-30T18:21:41+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.24.0",
+ "version": "v1.29.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
- "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
"shasum": ""
},
"require": {
@@ -2016,9 +2142,6 @@
},
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -2062,7 +2185,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
},
"funding": [
{
@@ -2078,32 +2201,35 @@
"type": "tidelift"
}
],
- "time": "2021-09-13T13:58:33+00:00"
+ "time": "2024-01-29T20:11:03+00:00"
},
{
"name": "symfony/translation",
- "version": "v6.0.5",
+ "version": "v6.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875"
+ "reference": "637c51191b6b184184bbf98937702bcf554f7d04"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/e69501c71107cc3146b32aaa45f4edd0c3427875",
- "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/637c51191b6b184184bbf98937702bcf554f7d04",
+ "reference": "637c51191b6b184184bbf98937702bcf554f7d04",
"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"
},
@@ -2111,22 +2237,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": {
@@ -2157,7 +2280,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v6.0.5"
+ "source": "https://github.com/symfony/translation/tree/v6.4.3"
},
"funding": [
{
@@ -2173,32 +2296,29 @@
"type": "tidelift"
}
],
- "time": "2022-02-09T15:52:48+00:00"
+ "time": "2024-01-29T13:11:52+00:00"
},
{
"name": "symfony/translation-contracts",
- "version": "v3.0.0",
+ "version": "v3.4.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
- "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77"
+ "reference": "06450585bf65e978026bda220cdebca3f867fde7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77",
- "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77",
+ "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/06450585bf65e978026bda220cdebca3f867fde7",
+ "reference": "06450585bf65e978026bda220cdebca3f867fde7",
"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.4-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -2208,7 +2328,10 @@
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Translation\\": ""
- }
+ },
+ "exclude-from-classmap": [
+ "/Test/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -2235,7 +2358,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0"
+ "source": "https://github.com/symfony/translation-contracts/tree/v3.4.1"
},
"funding": [
{
@@ -2251,42 +2374,39 @@
"type": "tidelift"
}
],
- "time": "2021-09-07T12:43:40+00:00"
+ "time": "2023-12-26T14:02:43+00:00"
},
{
"name": "symfony/var-dumper",
- "version": "v6.0.5",
+ "version": "v6.4.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce"
+ "reference": "0435a08f69125535336177c29d56af3abc1f69da"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/60d6a756d5f485df5e6e40b337334848f79f61ce",
- "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0435a08f69125535336177c29d56af3abc1f69da",
+ "reference": "0435a08f69125535336177c29d56af3abc1f69da",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "phpunit/phpunit": "<5.4.3",
"symfony/console": "<5.4"
},
"require-dev": {
"ext-iconv": "*",
- "symfony/console": "^5.4|^6.0",
- "symfony/process": "^5.4|^6.0",
- "symfony/uid": "^5.4|^6.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/error-handler": "^6.3|^7.0",
+ "symfony/http-kernel": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/uid": "^5.4|^6.0|^7.0",
"twig/twig": "^2.13|^3.0.4"
},
- "suggest": {
- "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
- "ext-intl": "To show region name in time zone dump",
- "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
- },
"bin": [
"Resources/bin/var-dump-server"
],
@@ -2323,7 +2443,7 @@
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v6.0.5"
+ "source": "https://github.com/symfony/var-dumper/tree/v6.4.3"
},
"funding": [
{
@@ -2339,24 +2459,24 @@
"type": "tidelift"
}
],
- "time": "2022-02-21T17:15:17+00:00"
+ "time": "2024-01-23T14:53:30+00:00"
},
{
"name": "tightenco/collect",
- "version": "v8.83.2",
+ "version": "v9.52.7",
"source": {
"type": "git",
"url": "https://github.com/tighten/collect.git",
- "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722"
+ "reference": "b15143cd11fe01a700fcc449df61adc64452fa6d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/tighten/collect/zipball/d9c66d586ec2d216d8a31283d73f8df1400cc722",
- "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722",
+ "url": "https://api.github.com/repos/tighten/collect/zipball/b15143cd11fe01a700fcc449df61adc64452fa6d",
+ "reference": "b15143cd11fe01a700fcc449df61adc64452fa6d",
"shasum": ""
},
"require": {
- "php": "^7.3|^8.0",
+ "php": "^8.0",
"symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
@@ -2391,9 +2511,9 @@
],
"support": {
"issues": "https://github.com/tighten/collect/issues",
- "source": "https://github.com/tighten/collect/tree/v8.83.2"
+ "source": "https://github.com/tighten/collect/tree/v9.52.7"
},
- "time": "2022-02-16T16:15:54+00:00"
+ "time": "2023-04-14T21:51:36+00:00"
},
{
"name": "twig/twig",
@@ -2480,5 +2600,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
- "plugin-api-version": "2.3.0"
+ "plugin-api-version": "2.6.0"
}
diff --git a/data/web/inc/lib/vendor/autoload.php b/data/web/inc/lib/vendor/autoload.php
index c21364e8..a0fb8f4a 100644
--- a/data/web/inc/lib/vendor/autoload.php
+++ b/data/web/inc/lib/vendor/autoload.php
@@ -3,8 +3,21 @@
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
- echo '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;
- exit(1);
+ 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';
diff --git a/data/web/inc/lib/vendor/bin/carbon b/data/web/inc/lib/vendor/bin/carbon
index 7b63379a..86fbfdfd 100755
--- a/data/web/inc/lib/vendor/bin/carbon
+++ b/data/web/inc/lib/vendor/bin/carbon
@@ -12,6 +12,7 @@
namespace Composer;
+$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
@@ -23,18 +24,17 @@ if (PHP_VERSION_ID < 80000) {
{
private $handle;
private $position;
+ private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
- // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution
- $opened_path = substr($path, 21);
- $opened_path = realpath($opened_path) ?: $opened_path;
- $this->handle = fopen($opened_path, $mode);
+ // 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;
- // remove all traces of this stream wrapper once it has been used
- stream_wrapper_unregister('composer-bin-proxy');
-
return (bool) $this->handle;
}
@@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) {
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;
@@ -78,20 +88,32 @@ if (PHP_VERSION_ID < 80000) {
public function stream_stat()
{
- return fstat($this->handle);
+ 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_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) {
- include("composer-bin-proxy://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon');
- exit(0);
+ 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 __DIR__ . '/..'.'/nesbot/carbon/bin/carbon';
+return include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon';
diff --git a/data/web/inc/lib/vendor/bin/var-dump-server b/data/web/inc/lib/vendor/bin/var-dump-server
index 1eafd5d9..18db1c1e 100755
--- a/data/web/inc/lib/vendor/bin/var-dump-server
+++ b/data/web/inc/lib/vendor/bin/var-dump-server
@@ -12,6 +12,7 @@
namespace Composer;
+$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
@@ -23,18 +24,17 @@ if (PHP_VERSION_ID < 80000) {
{
private $handle;
private $position;
+ private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
- // get rid of composer-bin-proxy:// prefix for __FILE__ & __DIR__ resolution
- $opened_path = substr($path, 21);
- $opened_path = realpath($opened_path) ?: $opened_path;
- $this->handle = fopen($opened_path, $mode);
+ // 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;
- // remove all traces of this stream wrapper once it has been used
- stream_wrapper_unregister('composer-bin-proxy');
-
return (bool) $this->handle;
}
@@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) {
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;
@@ -78,20 +88,32 @@ if (PHP_VERSION_ID < 80000) {
public function stream_stat()
{
- return fstat($this->handle);
+ 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_wrapper_register') && stream_wrapper_register('composer-bin-proxy', 'Composer\BinProxyWrapper')) {
- include("composer-bin-proxy://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
- exit(0);
+ 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 __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server';
+return include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server';
diff --git a/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/LICENSE b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/LICENSE
new file mode 100644
index 00000000..2ee1671d
--- /dev/null
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/LICENSE
@@ -0,0 +1,21 @@
+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:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/README.md b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/README.md
new file mode 100644
index 00000000..5a18121b
--- /dev/null
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/composer.json b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/composer.json
new file mode 100644
index 00000000..abf45c5f
--- /dev/null
+++ b/data/web/inc/lib/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": "[email protected]"
+ }
+ ],
+ "minimum-stability": "dev"
+}
diff --git a/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php
new file mode 100644
index 00000000..a63a9b8d
--- /dev/null
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php
@@ -0,0 +1,16 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Carbon\Doctrine;
+
+use Doctrine\DBAL\Platforms\AbstractPlatform;
+
+interface CarbonDoctrineType
+{
+ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform);
+
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform);
+
+ public function convertToDatabaseValue($value, AbstractPlatform $platform);
+}
diff --git a/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php
new file mode 100644
index 00000000..8fc6bef3
--- /dev/null
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonImmutableType.php
@@ -0,0 +1,9 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Carbon\Doctrine;
+
+class CarbonImmutableType extends DateTimeImmutableType implements CarbonDoctrineType
+{
+}
diff --git a/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php
new file mode 100644
index 00000000..206b0e37
--- /dev/null
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonType.php
@@ -0,0 +1,9 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Carbon\Doctrine;
+
+class CarbonType extends DateTimeType implements CarbonDoctrineType
+{
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php
similarity index 59%
rename from data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php
rename to data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php
index ecfe17e7..a8133117 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonTypeConverter.php
@@ -1,13 +1,6 @@
<?php
-/**
- * This file is part of the Carbon package.
- *
- * (c) Brian Nesbitt <[email protected]>
- *
- * 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\Carbon;
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 @@ use Exception;
*/
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<T>
*/
@@ -31,20 +37,12 @@ trait CarbonTypeConverter
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 @@ trait CarbonTypeConverter
/**
* @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 @@ trait CarbonTypeConverter
}
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 @@ trait CarbonTypeConverter
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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php
similarity index 70%
rename from data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php
rename to data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php
index 642fd413..cd9896f9 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeDefaultPrecision.php
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php
@@ -1,13 +1,6 @@
<?php
-/**
- * This file is part of the Carbon package.
- *
- * (c) Brian Nesbitt <[email protected]>
- *
- * 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php
similarity index 58%
rename from data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php
rename to data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php
index 49927103..fd6467e3 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeImmutableType.php
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeImmutableType.php
@@ -1,12 +1,12 @@
<?php
-/**
- * Thanks to https://github.com/flaushi for his suggestion:
- * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358
- */
+declare(strict_types=1);
+
namespace Carbon\Doctrine;
use Carbon\CarbonImmutable;
+use DateTimeImmutable;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\VarDateTimeImmutableType;
class DateTimeImmutableType extends VarDateTimeImmutableType implements CarbonDoctrineType
@@ -14,6 +14,14 @@ class DateTimeImmutableType extends VarDateTimeImmutableType implements CarbonDo
/** @use CarbonTypeConverter<CarbonImmutable> */
use CarbonTypeConverter;
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?CarbonImmutable
+ {
+ return $this->doConvertToPHPValue($value);
+ }
+
/**
* @return class-string<CarbonImmutable>
*/
diff --git a/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php
new file mode 100644
index 00000000..89e4b790
--- /dev/null
+++ b/data/web/inc/lib/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php
@@ -0,0 +1,24 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Carbon\Doctrine;
+
+use Carbon\Carbon;
+use DateTime;
+use Doctrine\DBAL\Platforms\AbstractPlatform;
+use Doctrine\DBAL\Types\VarDateTimeType;
+
+class DateTimeType extends VarDateTimeType implements CarbonDoctrineType
+{
+ /** @use CarbonTypeConverter<Carbon> */
+ use CarbonTypeConverter;
+
+ /**
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Carbon
+ {
+ return $this->doConvertToPHPValue($value);
+ }
+}
diff --git a/data/web/inc/lib/vendor/composer/ClassLoader.php b/data/web/inc/lib/vendor/composer/ClassLoader.php
index afef3fa2..7824d8f7 100644
--- a/data/web/inc/lib/vendor/composer/ClassLoader.php
+++ b/data/web/inc/lib/vendor/composer/ClassLoader.php
@@ -42,35 +42,37 @@ namespace Composer\Autoload;
*/
class ClassLoader
{
- /** @var ?string */
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
+ /** @var string|null */
private $vendorDir;
// PSR-4
/**
- * @var array[]
- * @psalm-var array<string, array<string, int>>
+ * @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
- * @var array[]
- * @psalm-var array<string, array<int, string>>
+ * @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
- * @var array[]
- * @psalm-var array<string, string>
+ * @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
- * @var array[]
- * @psalm-var array<string, array<string, string[]>>
+ * List of PSR-0 prefixes
+ *
+ * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
+ *
+ * @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
- * @var array[]
- * @psalm-var array<string, string>
+ * @var list<string>
*/
private $fallbackDirsPsr0 = array();
@@ -78,8 +80,7 @@ class ClassLoader
private $useIncludePath = false;
/**
- * @var string[]
- * @psalm-var array<string, string>
+ * @var array<string, string>
*/
private $classMap = array();
@@ -87,29 +88,29 @@ class ClassLoader
private $classMapAuthoritative = false;
/**
- * @var bool[]
- * @psalm-var array<string, bool>
+ * @var array<string, bool>
*/
private $missingClasses = array();
- /** @var ?string */
+ /** @var string|null */
private $apcuPrefix;
/**
- * @var self[]
+ * @var array<string, self>
*/
private static $registeredLoaders = array();
/**
- * @param ?string $vendorDir
+ * @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
}
/**
- * @return string[]
+ * @return array<string, list<string>>
*/
public function getPrefixes()
{
@@ -121,8 +122,7 @@ class ClassLoader
}
/**
- * @return array[]
- * @psalm-return array<string, array<int, string>>
+ * @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
@@ -130,8 +130,7 @@ class ClassLoader
}
/**
- * @return array[]
- * @psalm-return array<string, string>
+ * @return list<string>
*/
public function getFallbackDirs()
{
@@ -139,8 +138,7 @@ class ClassLoader
}
/**
- * @return array[]
- * @psalm-return array<string, string>
+ * @return list<string>
*/
public function getFallbackDirsPsr4()
{
@@ -148,8 +146,7 @@ class ClassLoader
}
/**
- * @return string[] Array of classname => path
- * @psalm-return array<string, string>
+ * @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
@@ -157,8 +154,7 @@ class ClassLoader
}
/**
- * @param string[] $classMap Class to filename map
- * @psalm-param array<string, string> $classMap
+ * @param array<string, string> $classMap Class to filename map
*
* @return void
*/
@@ -175,24 +171,25 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param string[]|string $paths The PSR-0 root directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix
+ * @param list<string>|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
);
}
@@ -201,19 +198,19 @@ class ClassLoader
$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
);
}
}
@@ -222,9 +219,9 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param string[]|string $paths The PSR-4 base directories
- * @param bool $prepend Whether to prepend the directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list<string>|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
@@ -232,17 +229,18 @@ class ClassLoader
*/
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])) {
@@ -252,18 +250,18 @@ class ClassLoader
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
);
}
}
@@ -272,8 +270,8 @@ class ClassLoader
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
- * @param string $prefix The prefix
- * @param string[]|string $paths The PSR-0 base directories
+ * @param string $prefix The prefix
+ * @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
@@ -290,8 +288,8 @@ class ClassLoader
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
- * @param string $prefix The prefix/namespace, with trailing '\\'
- * @param string[]|string $paths The PSR-4 base directories
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
@@ -425,7 +423,8 @@ class ClassLoader
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
- includeFile($file);
+ $includeFile = self::$includeFile;
+ $includeFile($file);
return true;
}
@@ -476,9 +475,9 @@ class ClassLoader
}
/**
- * 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<string, self>
*/
public static function getRegisteredLoaders()
{
@@ -555,18 +554,26 @@ class ClassLoader
return false;
}
-}
-/**
- * Scope isolated include.
- *
- * Prevents access to $this/self from included files.
- *
- * @param string $file
- * @return void
- * @private
- */
-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/data/web/inc/lib/vendor/composer/InstalledVersions.php b/data/web/inc/lib/vendor/composer/InstalledVersions.php
index c6b54af7..51e734a7 100644
--- a/data/web/inc/lib/vendor/composer/InstalledVersions.php
+++ b/data/web/inc/lib/vendor/composer/InstalledVersions.php
@@ -98,7 +98,7 @@ class InstalledVersions
{
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;
}
}
@@ -119,7 +119,7 @@ class InstalledVersions
*/
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);
@@ -328,7 +328,9 @@ class InstalledVersions
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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $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];
}
@@ -340,12 +342,17 @@ class InstalledVersions
// 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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $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/data/web/inc/lib/vendor/composer/autoload_classmap.php b/data/web/inc/lib/vendor/composer/autoload_classmap.php
index a986241b..5490b88d 100644
--- a/data/web/inc/lib/vendor/composer/autoload_classmap.php
+++ b/data/web/inc/lib/vendor/composer/autoload_classmap.php
@@ -8,6 +8,7 @@ $baseDir = dirname($vendorDir);
return array(
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
+ 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
diff --git a/data/web/inc/lib/vendor/composer/autoload_files.php b/data/web/inc/lib/vendor/composer/autoload_files.php
index 2730ec34..bac0d960 100644
--- a/data/web/inc/lib/vendor/composer/autoload_files.php
+++ b/data/web/inc/lib/vendor/composer/autoload_files.php
@@ -6,12 +6,12 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
+ '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
- '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
- '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
+ '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php',
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
diff --git a/data/web/inc/lib/vendor/composer/autoload_psr4.php b/data/web/inc/lib/vendor/composer/autoload_psr4.php
index 8e959eac..9b7aef88 100644
--- a/data/web/inc/lib/vendor/composer/autoload_psr4.php
+++ b/data/web/inc/lib/vendor/composer/autoload_psr4.php
@@ -21,6 +21,7 @@ return array(
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
+ 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'),
'PhpMimeMailParser\\' => array($vendorDir . '/php-mime-mail-parser/php-mime-mail-parser/src'),
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
'MatthiasMullie\\PathConverter\\' => array($vendorDir . '/matthiasmullie/path-converter/src'),
@@ -34,5 +35,6 @@ return array(
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
'Ddeboer\\Imap\\' => array($vendorDir . '/ddeboer/imap/src'),
+ 'Carbon\\Doctrine\\' => array($vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine'),
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
);
diff --git a/data/web/inc/lib/vendor/composer/autoload_real.php b/data/web/inc/lib/vendor/composer/autoload_real.php
index 6891b0c9..5e208253 100644
--- a/data/web/inc/lib/vendor/composer/autoload_real.php
+++ b/data/web/inc/lib/vendor/composer/autoload_real.php
@@ -33,25 +33,18 @@ class ComposerAutoloaderInit873464e4bd965a3168f133248b1b218b
$loader->register(true);
- $includeFiles = \Composer\Autoload\ComposerStaticInit873464e4bd965a3168f133248b1b218b::$files;
- foreach ($includeFiles as $fileIdentifier => $file) {
- composerRequire873464e4bd965a3168f133248b1b218b($fileIdentifier, $file);
+ $filesToLoad = \Composer\Autoload\ComposerStaticInit873464e4bd965a3168f133248b1b218b::$files;
+ $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+
+ require $file;
+ }
+ }, null, null);
+ foreach ($filesToLoad as $fileIdentifier => $file) {
+ $requireFile($fileIdentifier, $file);
}
return $loader;
}
}
-
-/**
- * @param string $fileIdentifier
- * @param string $file
- * @return void
- */
-function composerRequire873464e4bd965a3168f133248b1b218b($fileIdentifier, $file)
-{
- if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
- $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
-
- require $file;
- }
-}
diff --git a/data/web/inc/lib/vendor/composer/autoload_static.php b/data/web/inc/lib/vendor/composer/autoload_static.php
index 27a95eda..7564e972 100644
--- a/data/web/inc/lib/vendor/composer/autoload_static.php
+++ b/data/web/inc/lib/vendor/composer/autoload_static.php
@@ -7,12 +7,12 @@ namespace Composer\Autoload;
class ComposerStaticInit873464e4bd965a3168f133248b1b218b
{
public static $files = array (
+ '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
- '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
- '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
+ '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php',
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -48,6 +48,7 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b
'Psr\\Http\\Message\\' => 17,
'Psr\\Http\\Client\\' => 16,
'Psr\\Container\\' => 14,
+ 'Psr\\Clock\\' => 10,
'PhpMimeMailParser\\' => 18,
'PHPMailer\\PHPMailer\\' => 20,
),
@@ -85,6 +86,7 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b
),
'C' =>
array (
+ 'Carbon\\Doctrine\\' => 16,
'Carbon\\' => 7,
),
);
@@ -151,6 +153,10 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b
array (
0 => __DIR__ . '/..' . '/psr/container/src',
),
+ 'Psr\\Clock\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/clock/src',
+ ),
'PhpMimeMailParser\\' =>
array (
0 => __DIR__ . '/..' . '/php-mime-mail-parser/php-mime-mail-parser/src',
@@ -203,6 +209,10 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b
array (
0 => __DIR__ . '/..' . '/ddeboer/imap/src',
),
+ 'Carbon\\Doctrine\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine',
+ ),
'Carbon\\' =>
array (
0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon',
@@ -222,6 +232,7 @@ class ComposerStaticInit873464e4bd965a3168f133248b1b218b
public static $classMap = array (
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
diff --git a/data/web/inc/lib/vendor/composer/installed.json b/data/web/inc/lib/vendor/composer/installed.json
index c5f82771..a9a3966f 100644
--- a/data/web/inc/lib/vendor/composer/installed.json
+++ b/data/web/inc/lib/vendor/composer/installed.json
@@ -61,6 +61,78 @@
],
"install-path": "../bshaffer/oauth2-server-php"
},
+ {
+ "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": "[email protected]"
+ }
+ ],
+ "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": "ddeboer/imap",
"version": "1.13.1",
@@ -141,35 +213,36 @@
},
{
"name": "directorytree/ldaprecord",
- "version": "v2.10.1",
- "version_normalized": "2.10.1.0",
+ "version": "v2.20.5",
+ "version_normalized": "2.20.5.0",
"source": {
"type": "git",
"url": "https://github.com/DirectoryTree/LdapRecord.git",
- "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88"
+ "reference": "5bd0a5a9d257cf1049ae83055dbba4c3479ddf16"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/bf512d9af7a7b0e2ed7a666ab29cefdd027bee88",
- "reference": "bf512d9af7a7b0e2ed7a666ab29cefdd027bee88",
+ "url": "https://api.github.com/repos/DirectoryTree/LdapRecord/zipball/5bd0a5a9d257cf1049ae83055dbba4c3479ddf16",
+ "reference": "5bd0a5a9d257cf1049ae83055dbba4c3479ddf16",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-ldap": "*",
- "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0",
+ "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"nesbot/carbon": "^1.0|^2.0",
"php": ">=7.3",
- "psr/log": "*",
+ "psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0",
- "tightenco/collect": "^5.6|^6.0|^7.0|^8.0"
+ "symfony/polyfill-php80": "^1.25",
+ "tightenco/collect": "^5.6|^6.0|^7.0|^8.0|^9.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^9.0",
"spatie/ray": "^1.24"
},
- "time": "2022-02-25T16:00:51+00:00",
+ "time": "2023-10-11T16:34:34+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -620,29 +693,29 @@
},
{
"name": "illuminate/contracts",
- "version": "v9.3.0",
- "version_normalized": "9.3.0.0",
+ "version": "v10.44.0",
+ "version_normalized": "10.44.0.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/contracts.git",
- "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0"
+ "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/illuminate/contracts/zipball/bf4b3c254c49d28157645d01e4883b5951b1e1d0",
- "reference": "bf4b3c254c49d28157645d01e4883b5951b1e1d0",
+ "url": "https://api.github.com/repos/illuminate/contracts/zipball/8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac",
+ "reference": "8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac",
"shasum": ""
},
"require": {
- "php": "^8.0.2",
+ "php": "^8.1",
"psr/container": "^1.1.1|^2.0.1",
"psr/simple-cache": "^1.0|^2.0|^3.0"
},
- "time": "2022-02-22T14:45:39+00:00",
+ "time": "2024-01-15T18:52:32+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.x-dev"
+ "dev-master": "10.x-dev"
}
},
"installation-source": "dist",
@@ -930,38 +1003,45 @@
},
{
"name": "nesbot/carbon",
- "version": "2.57.0",
- "version_normalized": "2.57.0.0",
+ "version": "2.72.3",
+ "version_normalized": "2.72.3.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
- "reference": "4a54375c21eea4811dbd1149fe6b246517554e78"
+ "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4a54375c21eea4811dbd1149fe6b246517554e78",
- "reference": "4a54375c21eea4811dbd1149fe6b246517554e78",
+ "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0c6fd108360c562f6e4fd1dedb8233b423e91c83",
+ "reference": "0c6fd108360c562f6e4fd1dedb8233b423e91c83",
"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.0",
- "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": "*",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^0.12.54 || ^1.0",
- "phpunit/phpunit": "^7.5.20 || ^8.5.14",
+ "phpstan/phpstan": "^0.12.99 || ^1.7.14",
+ "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20",
"squizlabs/php_codesniffer": "^3.4"
},
- "time": "2022-02-13T18:13:33+00:00",
+ "time": "2024-01-25T10:35:09+00:00",
"bin": [
"bin/carbon"
],
@@ -1017,11 +1097,15 @@
},
"funding": [
{
- "url": "https://opencollective.com/Carbon",
- "type": "open_collective"
+ "url": "https://github.com/sponsors/kylekatarnls",
+ "type": "github"
},
{
- "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon",
+ "url": "https://opencollective.com/Carbon#sponsor",
+ "type": "opencollective"
+ },
+ {
+ "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme",
"type": "tidelift"
}
],
@@ -1255,6 +1339,57 @@
],
"install-path": "../phpmailer/phpmailer"
},
+ {
+ "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": "2.0.2",
@@ -1826,27 +1961,27 @@
},
{
"name": "symfony/deprecation-contracts",
- "version": "v3.2.1",
- "version_normalized": "3.2.1.0",
+ "version": "v3.4.0",
+ "version_normalized": "3.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e"
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e",
- "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
"shasum": ""
},
"require": {
"php": ">=8.1"
},
- "time": "2023-03-01T10:25:55+00:00",
+ "time": "2023-05-23T14:45:45+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.3-dev"
+ "dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -1876,7 +2011,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.2.1"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
},
"funding": [
{
@@ -1981,17 +2116,17 @@
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.24.0",
- "version_normalized": "1.24.0.0",
+ "version": "v1.29.0",
+ "version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
- "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
"shasum": ""
},
"require": {
@@ -2003,12 +2138,9 @@
"suggest": {
"ext-mbstring": "For best performance"
},
- "time": "2021-11-30T18:21:41+00:00",
+ "time": "2024-01-29T20:11:03+00:00",
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -2047,7 +2179,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
},
"funding": [
{
@@ -2067,28 +2199,25 @@
},
{
"name": "symfony/polyfill-php80",
- "version": "v1.24.0",
- "version_normalized": "1.24.0.0",
+ "version": "v1.29.0",
+ "version_normalized": "1.29.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9"
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9",
- "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "time": "2021-09-13T13:58:33+00:00",
+ "time": "2024-01-29T20:11:03+00:00",
"type": "library",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
@@ -2133,7 +2262,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0"
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
},
"funding": [
{
@@ -2153,29 +2282,32 @@
},
{
"name": "symfony/translation",
- "version": "v6.0.5",
- "version_normalized": "6.0.5.0",
+ "version": "v6.4.3",
+ "version_normalized": "6.4.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875"
+ "reference": "637c51191b6b184184bbf98937702bcf554f7d04"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/e69501c71107cc3146b32aaa45f4edd0c3427875",
- "reference": "e69501c71107cc3146b32aaa45f4edd0c3427875",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/637c51191b6b184184bbf98937702bcf554f7d04",
+ "reference": "637c51191b6b184184bbf98937702bcf554f7d04",
"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"
},
@@ -2183,24 +2315,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": "2022-02-09T15:52:48+00:00",
+ "time": "2024-01-29T13:11:52+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -2231,7 +2360,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v6.0.5"
+ "source": "https://github.com/symfony/translation/tree/v6.4.3"
},
"funding": [
{
@@ -2251,30 +2380,27 @@
},
{
"name": "symfony/translation-contracts",
- "version": "v3.0.0",
- "version_normalized": "3.0.0.0",
+ "version": "v3.4.1",
+ "version_normalized": "3.4.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
- "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77"
+ "reference": "06450585bf65e978026bda220cdebca3f867fde7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77",
- "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77",
+ "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/06450585bf65e978026bda220cdebca3f867fde7",
+ "reference": "06450585bf65e978026bda220cdebca3f867fde7",
"shasum": ""
},
"require": {
- "php": ">=8.0.2"
- },
- "suggest": {
- "symfony/translation-implementation": ""
+ "php": ">=8.1"
},
- "time": "2021-09-07T12:43:40+00:00",
+ "time": "2023-12-26T14:02:43+00:00",
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "3.0-dev"
+ "dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -2285,7 +2411,10 @@
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Translation\\": ""
- }
+ },
+ "exclude-from-classmap": [
+ "/Test/"
+ ]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -2312,7 +2441,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0"
+ "source": "https://github.com/symfony/translation-contracts/tree/v3.4.1"
},
"funding": [
{
@@ -2332,40 +2461,37 @@
},
{
"name": "symfony/var-dumper",
- "version": "v6.0.5",
- "version_normalized": "6.0.5.0",
+ "version": "v6.4.3",
+ "version_normalized": "6.4.3.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce"
+ "reference": "0435a08f69125535336177c29d56af3abc1f69da"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/60d6a756d5f485df5e6e40b337334848f79f61ce",
- "reference": "60d6a756d5f485df5e6e40b337334848f79f61ce",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0435a08f69125535336177c29d56af3abc1f69da",
+ "reference": "0435a08f69125535336177c29d56af3abc1f69da",
"shasum": ""
},
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
- "phpunit/phpunit": "<5.4.3",
"symfony/console": "<5.4"
},
"require-dev": {
"ext-iconv": "*",
- "symfony/console": "^5.4|^6.0",
- "symfony/process": "^5.4|^6.0",
- "symfony/uid": "^5.4|^6.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/error-handler": "^6.3|^7.0",
+ "symfony/http-kernel": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/uid": "^5.4|^6.0|^7.0",
"twig/twig": "^2.13|^3.0.4"
},
- "suggest": {
- "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
- "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": "2022-02-21T17:15:17+00:00",
+ "time": "2024-01-23T14:53:30+00:00",
"bin": [
"Resources/bin/var-dump-server"
],
@@ -2403,7 +2529,7 @@
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v6.0.5"
+ "source": "https://github.com/symfony/var-dumper/tree/v6.4.3"
},
"funding": [
{
@@ -2423,21 +2549,21 @@
},
{
"name": "tightenco/collect",
- "version": "v8.83.2",
- "version_normalized": "8.83.2.0",
+ "version": "v9.52.7",
+ "version_normalized": "9.52.7.0",
"source": {
"type": "git",
"url": "https://github.com/tighten/collect.git",
- "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722"
+ "reference": "b15143cd11fe01a700fcc449df61adc64452fa6d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/tighten/collect/zipball/d9c66d586ec2d216d8a31283d73f8df1400cc722",
- "reference": "d9c66d586ec2d216d8a31283d73f8df1400cc722",
+ "url": "https://api.github.com/repos/tighten/collect/zipball/b15143cd11fe01a700fcc449df61adc64452fa6d",
+ "reference": "b15143cd11fe01a700fcc449df61adc64452fa6d",
"shasum": ""
},
"require": {
- "php": "^7.3|^8.0",
+ "php": "^8.0",
"symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
@@ -2445,7 +2571,7 @@
"nesbot/carbon": "^2.23.0",
"phpunit/phpunit": "^8.3"
},
- "time": "2022-02-16T16:15:54+00:00",
+ "time": "2023-04-14T21:51:36+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -2474,7 +2600,7 @@
],
"support": {
"issues": "https://github.com/tighten/collect/issues",
- "source": "https://github.com/tighten/collect/tree/v8.83.2"
+ "source": "https://github.com/tighten/collect/tree/v9.52.7"
},
"install-path": "../tightenco/collect"
},
diff --git a/data/web/inc/lib/vendor/composer/installed.php b/data/web/inc/lib/vendor/composer/installed.php
index 0616e9a8..fed449fa 100644
--- a/data/web/inc/lib/vendor/composer/installed.php
+++ b/data/web/inc/lib/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '96390c2e12fd8d886495fde5514ad431e4e66069',
+ 'reference' => '40146839efb3754b2db4045f0111178ffd1883c5',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '96390c2e12fd8d886495fde5514ad431e4e66069',
+ 'reference' => '40146839efb3754b2db4045f0111178ffd1883c5',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -28,6 +28,15 @@
'aliases' => array(),
'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,
+ ),
'ddeboer/imap' => array(
'pretty_version' => '1.13.1',
'version' => '1.13.1.0',
@@ -38,9 +47,9 @@
'dev_requirement' => false,
),
'directorytree/ldaprecord' => array(
- 'pretty_version' => 'v2.10.1',
- 'version' => '2.10.1.0',
- 'reference' => 'bf512d9af7a7b0e2ed7a666ab29cefdd027bee88',
+ 'pretty_version' => 'v2.20.5',
+ 'version' => '2.20.5.0',
+ 'reference' => '5bd0a5a9d257cf1049ae83055dbba4c3479ddf16',
'type' => 'library',
'install_path' => __DIR__ . '/../directorytree/ldaprecord',
'aliases' => array(),
@@ -89,9 +98,9 @@
'dev_requirement' => false,
),
'illuminate/contracts' => array(
- 'pretty_version' => 'v9.3.0',
- 'version' => '9.3.0.0',
- 'reference' => 'bf4b3c254c49d28157645d01e4883b5951b1e1d0',
+ 'pretty_version' => 'v10.44.0',
+ 'version' => '10.44.0.0',
+ 'reference' => '8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac',
'type' => 'library',
'install_path' => __DIR__ . '/../illuminate/contracts',
'aliases' => array(),
@@ -140,9 +149,9 @@
'dev_requirement' => false,
),
'nesbot/carbon' => array(
- 'pretty_version' => '2.57.0',
- 'version' => '2.57.0.0',
- 'reference' => '4a54375c21eea4811dbd1149fe6b246517554e78',
+ 'pretty_version' => '2.72.3',
+ 'version' => '2.72.3.0',
+ 'reference' => '0c6fd108360c562f6e4fd1dedb8233b423e91c83',
'type' => 'library',
'install_path' => __DIR__ . '/../nesbot/carbon',
'aliases' => array(),
@@ -175,6 +184,21 @@
'aliases' => array(),
'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' => '2.0.2',
'version' => '2.0.2.0',
@@ -284,9 +308,9 @@
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
- 'pretty_version' => 'v3.2.1',
- 'version' => '3.2.1.0',
- 'reference' => 'e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e',
+ 'pretty_version' => 'v3.4.0',
+ 'version' => '3.4.0.0',
+ 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
@@ -302,36 +326,36 @@
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
- 'pretty_version' => 'v1.24.0',
- 'version' => '1.24.0.0',
- 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825',
+ 'pretty_version' => 'v1.29.0',
+ 'version' => '1.29.0.0',
+ 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
- 'pretty_version' => 'v1.24.0',
- 'version' => '1.24.0.0',
- 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
+ 'pretty_version' => 'v1.29.0',
+ 'version' => '1.29.0.0',
+ 'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/translation' => array(
- 'pretty_version' => 'v6.0.5',
- 'version' => '6.0.5.0',
- 'reference' => 'e69501c71107cc3146b32aaa45f4edd0c3427875',
+ 'pretty_version' => 'v6.4.3',
+ 'version' => '6.4.3.0',
+ 'reference' => '637c51191b6b184184bbf98937702bcf554f7d04',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/translation',
'aliases' => array(),
'dev_requirement' => false,
),
'symfony/translation-contracts' => array(
- 'pretty_version' => 'v3.0.0',
- 'version' => '3.0.0.0',
- 'reference' => '1b6ea5a7442af5a12dba3dbd6d71034b5b234e77',
+ 'pretty_version' => 'v3.4.1',
+ 'version' => '3.4.1.0',
+ 'reference' => '06450585bf65e978026bda220cdebca3f867fde7',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/translation-contracts',
'aliases' => array(),
@@ -344,18 +368,18 @@
),
),
'symfony/var-dumper' => array(
- 'pretty_version' => 'v6.0.5',
- 'version' => '6.0.5.0',
- 'reference' => '60d6a756d5f485df5e6e40b337334848f79f61ce',
+ 'pretty_version' => 'v6.4.3',
+ 'version' => '6.4.3.0',
+ 'reference' => '0435a08f69125535336177c29d56af3abc1f69da',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-dumper',
'aliases' => array(),
'dev_requirement' => false,
),
'tightenco/collect' => array(
- 'pretty_version' => 'v8.83.2',
- 'version' => '8.83.2.0',
- 'reference' => 'd9c66d586ec2d216d8a31283d73f8df1400cc722',
+ 'pretty_version' => 'v9.52.7',
+ 'version' => '9.52.7.0',
+ 'reference' => 'b15143cd11fe01a700fcc449df61adc64452fa6d',
'type' => 'library',
'install_path' => __DIR__ . '/../tightenco/collect',
'aliases' => array(),
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/bug_report.md b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/bug_report.md
index a56a2afb..4cbf18f9 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/bug_report.md
@@ -7,7 +7,10 @@ assignees: ''
---
-<!-- Please update the below information with your environment. -->
+<!--
+ Please update the below information with your environment.
+ Issues filed without the below information will be closed.
+-->
**Environment:**
- LDAP Server Type: [e.g. ActiveDirectory / OpenLDAP / FreeIPA]
- PHP Version: [e.g. 7.3 / 7.4 / 8.0]
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/support---help-request.md b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/support---help-request.md
index 230916cf..731d5cea 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/support---help-request.md
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/ISSUE_TEMPLATE/support---help-request.md
@@ -11,7 +11,10 @@ assignees: ''
<!-- https://github.com/sponsors/stevebauman -->
<!-- Thank you for your understanding. -->
-<!-- Please update the below information with your environment. -->
+<!--
+ Please update the below information with your environment.
+ Issues filed without the below information will be closed.
+-->
**Environment:**
- LDAP Server Type: [e.g. ActiveDirectory / OpenLDAP / FreeIPA]
- PHP Version: [e.g. 7.3 / 7.4 / 8.0]
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-integration-tests.yml b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-integration-tests.yml
new file mode 100644
index 00000000..6a6b2f9e
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-integration-tests.yml
@@ -0,0 +1,62 @@
+name: run-integration-tests
+
+on:
+ push:
+ pull_request:
+ schedule:
+ - cron: "0 0 * * *"
+
+jobs:
+ run-tests:
+ runs-on: ${{ matrix.os }}
+
+ services:
+ ldap:
+ image: osixia/openldap:1.4.0
+ env:
+ LDAP_TLS_VERIFY_CLIENT: try
+ LDAP_OPENLDAP_UID: 1000
+ LDAP_OPENLDAP_GID: 1000
+ LDAP_ORGANISATION: Local
+ LDAP_DOMAIN: local.com
+ LDAP_ADMIN_PASSWORD: secret
+ ports:
+ - 389:389
+ - 636:636
+
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest]
+ php: [8.1, 8.0, 7.4]
+
+ name: ${{ matrix.os }} - P${{ matrix.php }}
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Cache dependencies
+ uses: actions/cache@v2
+ with:
+ path: ~/.composer/cache/files
+ key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
+
+ - name: Set ldap.conf file permissions
+ run: sudo chown -R $USER:$USER /etc/ldap/ldap.conf
+
+ - name: Create ldap.conf file disabling TLS verification
+ run: sudo echo "TLS_REQCERT never" > "/etc/ldap/ldap.conf"
+
+ - name: Setup PHP
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php }}
+ extensions: ldap, json
+ coverage: none
+
+ - name: Install dependencies
+ run: composer update --prefer-dist --no-interaction
+
+ - name: Execute tests
+ run: vendor/bin/phpunit --testsuite Integration
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml
index 44825dc2..6aaa3fd4 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.github/workflows/run-tests.yml
@@ -9,20 +9,20 @@ on:
jobs:
run-tests:
runs-on: ${{ matrix.os }}
+ name: ${{ matrix.os }} - P${{ matrix.php }}
+
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1, 8.0, 7.4, 7.3]
- name: ${{ matrix.os }} - P${{ matrix.php }}
-
steps:
- name: Checkout code
- uses: actions/checkout@v4
+ uses: actions/checkout@v2
- name: Cache dependencies
- uses: actions/cache@v3
+ uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
@@ -38,41 +38,4 @@ jobs:
run: composer update --prefer-dist --no-interaction
- name: Execute tests
- run: vendor/bin/phpunit
-
- run-analysis:
- runs-on: ${{ matrix.os }}
- name: Static code analysis (PHP ${{ matrix.php }})
-
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest]
- php: [8.0]
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Cache dependencies
- uses: actions/cache@v3
- with:
- path: ~/.composer/cache/files
- key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
-
- - name: Setup PHP
- uses: shivammathur/setup-php@v2
- with:
- php-version: ${{ matrix.php }}
- extensions: ldap, json
- coverage: none
- tools: psalm
-
- - name: Validate composer.json
- run: composer validate
-
- - name: Install dependencies
- run: composer update --prefer-dist --no-interaction
-
- - name: Run Psalm
- run: psalm
+ run: vendor/bin/phpunit --testsuite Unit
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml b/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml
index 9f5e38cf..0285f179 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/.styleci.yml
@@ -1,8 +1 @@
preset: laravel
-enabled:
- - phpdoc_align
- - phpdoc_separation
- - unalign_double_arrow
-disabled:
- - laravel_phpdoc_alignment
- - laravel_phpdoc_separation
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json b/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json
index 35c60576..65d7dd8f 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/composer.json
@@ -32,11 +32,12 @@
"php": ">=7.3",
"ext-ldap": "*",
"ext-json": "*",
- "psr/log": "*",
+ "psr/log": "^1.0|^2.0|^3.0",
"psr/simple-cache": "^1.0|^2.0",
"nesbot/carbon": "^1.0|^2.0",
- "tightenco/collect": "^5.6|^6.0|^7.0|^8.0",
- "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0"
+ "tightenco/collect": "^5.6|^6.0|^7.0|^8.0|^9.0",
+ "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
+ "symfony/polyfill-php80": "^1.25"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/docker-compose.yml b/data/web/inc/lib/vendor/directorytree/ldaprecord/docker-compose.yml
new file mode 100644
index 00000000..de96b139
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/docker-compose.yml
@@ -0,0 +1,35 @@
+version: '3'
+
+services:
+ ldap:
+ image: osixia/openldap:1.4.0
+ container_name: ldap
+ restart: always
+ hostname: local.com
+ environment:
+ LDAP_TLS_VERIFY_CLIENT: try
+ LDAP_OPENLDAP_UID: 1000
+ LDAP_OPENLDAP_GID: 1000
+ LDAP_ORGANISATION: Local
+ LDAP_DOMAIN : local.com
+ LDAP_ADMIN_PASSWORD: secret
+ ports:
+ - "389:389"
+ - "636:636"
+ networks:
+ - local
+
+ ldapadmin:
+ image: osixia/phpldapadmin:0.9.0
+ container_name: ldapadmin
+ environment:
+ PHPLDAPADMIN_LDAP_HOSTS: ldap
+ restart: always
+ ports:
+ - "6443:443"
+ networks:
+ - local
+
+networks:
+ local:
+ driver: bridge
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/phpunit.xml b/data/web/inc/lib/vendor/directorytree/ldaprecord/phpunit.xml
index d03fdc20..aed09e4d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/phpunit.xml
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/phpunit.xml
@@ -10,8 +10,11 @@
stopOnFailure="false"
>
<testsuites>
- <testsuite name="LdapRecord Test Suite">
- <directory suffix="Test.php">./tests/</directory>
+ <testsuite name="Unit">
+ <directory suffix="Test.php">./tests/Unit</directory>
+ </testsuite>
+ <testsuite name="Integration">
+ <directory suffix="Test.php">./tests/Integration</directory>
</testsuite>
</testsuites>
</phpunit>
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/psalm.xml b/data/web/inc/lib/vendor/directorytree/ldaprecord/psalm.xml
deleted file mode 100644
index 7c0333df..00000000
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/psalm.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<psalm
- errorLevel="7"
- resolveFromConfigFile="true"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="https://getpsalm.org/schema/config"
- xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
->
- <projectFiles>
- <directory name="src" />
- <ignoreFiles>
- <directory name="vendor" />
- </ignoreFiles>
- </projectFiles>
-</psalm>
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md b/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md
index 505d6992..e00f8ef6 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/readme.md
@@ -6,7 +6,7 @@
<p align="center">
<a href="https://github.com/DirectoryTree/LdapRecord/actions">
- <img src="https://img.shields.io/github/workflow/status/directorytree/ldaprecord/run-tests.svg?style=flat-square">
+ <img src="https://img.shields.io/github/actions/workflow/status/directorytree/ldaprecord/run-tests.yml?branch=master&style=flat-square">
</a>
<a href="https://scrutinizer-ci.com/g/DirectoryTree/LdapRecord/?branch=master">
<img src="https://img.shields.io/scrutinizer/g/DirectoryTree/LdapRecord/master.svg?style=flat-square"/>
@@ -45,7 +45,7 @@
⏲ **Up and Running Fast**
-Connect to your LDAP servers and start running queries at lightning speed.
+Connect to your LDAP servers and start running queries in a matter of minutes.
💡 **Fluent Filter Builder**
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php
index 83716b42..7c1bb3c8 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Events/Event.php
@@ -30,9 +30,9 @@ abstract class Event
/**
* Constructor.
*
- * @param LdapInterface $connection
- * @param string $username
- * @param string $password
+ * @param LdapInterface $connection
+ * @param string $username
+ * @param string $password
*/
public function __construct(LdapInterface $connection, $username, $password)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php
index d41af156..c00989ae 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Auth/Guard.php
@@ -38,8 +38,8 @@ class Guard
/**
* Constructor.
*
- * @param LdapInterface $connection
- * @param DomainConfiguration $configuration
+ * @param LdapInterface $connection
+ * @param DomainConfiguration $configuration
*/
public function __construct(LdapInterface $connection, DomainConfiguration $configuration)
{
@@ -50,10 +50,9 @@ class Guard
/**
* Attempt binding a user to the LDAP server.
*
- * @param string $username
- * @param string $password
- * @param bool $stayBound
- *
+ * @param string $username
+ * @param string $password
+ * @param bool $stayBound
* @return bool
*
* @throws UsernameRequiredException
@@ -90,8 +89,8 @@ class Guard
/**
* Attempt binding a user to the LDAP server. Supports anonymous binding.
*
- * @param string|null $username
- * @param string|null $password
+ * @param string|null $username
+ * @param string|null $password
*
* @throws BindException
* @throws \LdapRecord\ConnectionException
@@ -148,8 +147,7 @@ class Guard
/**
* Set the event dispatcher instance.
*
- * @param DispatcherInterface $dispatcher
- *
+ * @param DispatcherInterface $dispatcher
* @return void
*/
public function setDispatcher(DispatcherInterface $dispatcher)
@@ -160,9 +158,8 @@ class Guard
/**
* Fire the attempting event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireAttemptingEvent($username, $password)
@@ -175,9 +172,8 @@ class Guard
/**
* Fire the passed event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function firePassedEvent($username, $password)
@@ -190,9 +186,8 @@ class Guard
/**
* Fire the failed event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireFailedEvent($username, $password)
@@ -205,9 +200,8 @@ class Guard
/**
* Fire the binding event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireBindingEvent($username, $password)
@@ -220,9 +214,8 @@ class Guard
/**
* Fire the bound event.
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return void
*/
protected function fireBoundEvent($username, $password)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php
index d1124bfc..f71f63d8 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/DomainConfiguration.php
@@ -58,7 +58,7 @@ class DomainConfiguration
/**
* Constructor.
*
- * @param array $options
+ * @param array $options
*
* @throws ConfigurationException When an option value given is an invalid type.
*/
@@ -74,9 +74,8 @@ class DomainConfiguration
/**
* Extend the configuration with a custom option, or override an existing.
*
- * @param string $option
- * @param mixed $default
- *
+ * @param string $option
+ * @param mixed $default
* @return void
*/
public static function extend($option, $default = null)
@@ -107,8 +106,8 @@ class DomainConfiguration
/**
* Set a configuration option.
*
- * @param string $key
- * @param mixed $value
+ * @param string $key
+ * @param mixed $value
*
* @throws ConfigurationException When an option value given is an invalid type.
*/
@@ -122,8 +121,7 @@ class DomainConfiguration
/**
* Returns the value for the specified configuration options.
*
- * @param string $key
- *
+ * @param string $key
* @return mixed
*
* @throws ConfigurationException When the option specified does not exist.
@@ -140,8 +138,7 @@ class DomainConfiguration
/**
* Checks if a configuration option exists.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function has($key)
@@ -152,9 +149,8 @@ class DomainConfiguration
/**
* Validate the configuration option.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return bool
*
* @throws ConfigurationException When an option value given is an invalid type.
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php
index de2f13f5..d107314d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Configuration/Validators/Validator.php
@@ -30,8 +30,8 @@ abstract class Validator
/**
* Constructor.
*
- * @param string $key
- * @param mixed $value
+ * @param string $key
+ * @param mixed $value
*/
public function __construct($key, $value)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php
index d429aa46..6e55cffc 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Connection.php
@@ -88,8 +88,8 @@ class Connection
/**
* Constructor.
*
- * @param array $config
- * @param LdapInterface|null $ldap
+ * @param array|DomainConfiguration $config
+ * @param LdapInterface|null $ldap
*/
public function __construct($config = [], LdapInterface $ldap = null)
{
@@ -109,15 +109,18 @@ class Connection
/**
* Set the connection configuration.
*
- * @param array $config
- *
+ * @param array|DomainConfiguration $config
* @return $this
*
* @throws Configuration\ConfigurationException
*/
public function setConfiguration($config = [])
{
- $this->configuration = new DomainConfiguration($config);
+ if (! $config instanceof DomainConfiguration) {
+ $config = new DomainConfiguration($config);
+ }
+
+ $this->configuration = $config;
$this->hosts = $this->configuration->get('hosts');
@@ -129,8 +132,7 @@ class Connection
/**
* Set the LDAP connection.
*
- * @param LdapInterface $ldap
- *
+ * @param LdapInterface $ldap
* @return $this
*/
public function setLdapConnection(LdapInterface $ldap)
@@ -143,8 +145,7 @@ class Connection
/**
* Set the event dispatcher.
*
- * @param DispatcherInterface $dispatcher
- *
+ * @param DispatcherInterface $dispatcher
* @return $this
*/
public function setDispatcher(DispatcherInterface $dispatcher)
@@ -192,8 +193,7 @@ class Connection
/**
* Set the cache store.
*
- * @param CacheInterface $store
- *
+ * @param CacheInterface $store
* @return $this
*/
public function setCache(CacheInterface $store)
@@ -238,9 +238,8 @@ class Connection
*
* If no username or password is specified, then the configured credentials are used.
*
- * @param string|null $username
- * @param string|null $password
- *
+ * @param string|null $username
+ * @param string|null $password
* @return Connection
*
* @throws Auth\BindException
@@ -298,6 +297,16 @@ class Connection
$this->initialize();
}
+ /**
+ * Clone the connection.
+ *
+ * @return static
+ */
+ public function replicate()
+ {
+ return new static($this->configuration, new $this->ldap);
+ }
+
/**
* Disconnect from the LDAP server.
*
@@ -311,8 +320,7 @@ class Connection
/**
* Dispatch an event.
*
- * @param object $event
- *
+ * @param object $event
* @return void
*/
public function dispatch($event)
@@ -335,8 +343,7 @@ class Connection
/**
* Perform the operation on the LDAP connection.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*/
public function run(Closure $operation)
@@ -360,10 +367,26 @@ class Connection
}
/**
- * Attempt to get an exception for the cause of failure.
+ * Perform the operation on an isolated LDAP connection.
*
- * @param LdapRecordException $e
+ * @param Closure $operation
+ * @return mixed
+ */
+ public function isolate(Closure $operation)
+ {
+ $connection = $this->replicate();
+
+ try {
+ return $operation($connection);
+ } finally {
+ $connection->disconnect();
+ }
+ }
+
+ /**
+ * Attempt to get an exception for the cause of failure.
*
+ * @param LdapRecordException $e
* @return mixed
*/
protected function getExceptionForCauseOfFailure(LdapRecordException $e)
@@ -383,8 +406,7 @@ class Connection
/**
* Run the operation callback on the current LDAP connection.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -439,9 +461,8 @@ class Connection
/**
* Attempt to retry an LDAP operation if due to a lost connection.
*
- * @param LdapRecordException $e
- * @param Closure $operation
- *
+ * @param LdapRecordException $e
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -461,8 +482,7 @@ class Connection
/**
* Retry the operation on the current host.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -483,9 +503,8 @@ class Connection
/**
* Attempt the operation again on the next host.
*
- * @param LdapRecordException $e
- * @param Closure $operation
- *
+ * @param LdapRecordException $e
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php
index 01b072b4..0597f1f6 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/ConnectionManager.php
@@ -81,9 +81,8 @@ class ConnectionManager
/**
* Forward missing method calls onto the instance.
*
- * @param string $method
- * @param mixed $args
- *
+ * @param string $method
+ * @param mixed $args
* @return mixed
*/
public function __call($method, $args)
@@ -104,9 +103,8 @@ class ConnectionManager
/**
* Add a new connection.
*
- * @param Connection $connection
- * @param string|null $name
- *
+ * @param Connection $connection
+ * @param string|null $name
* @return $this
*/
public function add(Connection $connection, $name = null)
@@ -123,8 +121,7 @@ class ConnectionManager
/**
* Remove a connection.
*
- * @param $name
- *
+ * @param $name
* @return $this
*/
public function remove($name)
@@ -147,8 +144,7 @@ class ConnectionManager
/**
* Get a connection by name or return the default.
*
- * @param string|null $name
- *
+ * @param string|null $name
* @return Connection
*
* @throws ContainerException If the given connection does not exist.
@@ -185,8 +181,7 @@ class ConnectionManager
/**
* Checks if the connection exists.
*
- * @param string $name
- *
+ * @param string $name
* @return bool
*/
public function exists($name)
@@ -197,8 +192,7 @@ class ConnectionManager
/**
* Set the default connection name.
*
- * @param string $name
- *
+ * @param string $name
* @return $this
*/
public function setDefault($name = null)
@@ -237,8 +231,7 @@ class ConnectionManager
/**
* Set the event logger to use.
*
- * @param LoggerInterface $logger
- *
+ * @param LoggerInterface $logger
* @return void
*/
public function setLogger(LoggerInterface $logger)
@@ -299,8 +292,7 @@ class ConnectionManager
/**
* Set the event dispatcher.
*
- * @param DispatcherInterface $dispatcher
- *
+ * @param DispatcherInterface $dispatcher
* @return void
*/
public function setDispatcher(DispatcherInterface $dispatcher)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php
index f458951e..0c125593 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Container.php
@@ -48,9 +48,8 @@ class Container
/**
* Forward missing static calls onto the current instance.
*
- * @param string $method
- * @param mixed $args
- *
+ * @param string $method
+ * @param mixed $args
* @return mixed
*/
public static function __callStatic($method, $args)
@@ -71,8 +70,7 @@ class Container
/**
* Set the container instance.
*
- * @param Container|null $container
- *
+ * @param Container|null $container
* @return Container|null
*/
public static function setInstance(self $container = null)
@@ -103,9 +101,8 @@ class Container
/**
* Forward missing method calls onto the connection manager.
*
- * @param string $method
- * @param mixed $args
- *
+ * @param string $method
+ * @param mixed $args
* @return mixed
*/
public function __call($method, $args)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php
index d61159ed..fff528c9 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetailedError.php
@@ -28,9 +28,9 @@ class DetailedError
/**
* Constructor.
*
- * @param int $errorCode
- * @param string $errorMessage
- * @param string $diagnosticMessage
+ * @param int $errorCode
+ * @param string $errorMessage
+ * @param string $diagnosticMessage
*/
public function __construct($errorCode, $errorMessage, $diagnosticMessage)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php
index e8997a93..61fc4a02 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/DetectsErrors.php
@@ -7,8 +7,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by a lost connection.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function causedByLostConnection($error)
@@ -19,8 +18,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by lack of pagination support.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function causedByPaginationSupport($error)
@@ -31,8 +29,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by a size limit warning.
*
- * @param $error
- *
+ * @param $error
* @return bool
*/
protected function causedBySizeLimit($error)
@@ -43,8 +40,7 @@ trait DetectsErrors
/**
* Determine if the error was caused by a "No such object" warning.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function causedByNoSuchObject($error)
@@ -55,15 +51,14 @@ trait DetectsErrors
/**
* Determine if the error contains the any of the messages.
*
- * @param string $error
- * @param string|array $messages
- *
+ * @param string $error
+ * @param string|array $messages
* @return bool
*/
protected function errorContainsMessage($error, $messages = [])
{
foreach ((array) $messages as $message) {
- if (strpos($error, $message) !== false) {
+ if (str_contains((string) $error, $message)) {
return true;
}
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php
index acfc020b..ea53a2f9 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/EscapesValues.php
@@ -9,10 +9,9 @@ trait EscapesValues
/**
* Prepare a value to be escaped.
*
- * @param string $value
- * @param string $ignore
- * @param int $flags
- *
+ * @param string $value
+ * @param string $ignore
+ * @param int $flags
* @return EscapedValue
*/
public function escape($value, $ignore = '', $flags = 0)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php
index e9c2c352..d2d77e2f 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/ConnectionEvent.php
@@ -16,7 +16,7 @@ abstract class ConnectionEvent
/**
* Constructor.
*
- * @param Connection $connection
+ * @param Connection $connection
*/
public function __construct(Connection $connection)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php
index a4ae3def..4fedbc2e 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Dispatcher.php
@@ -46,7 +46,7 @@ class Dispatcher implements DispatcherInterface
public function listen($events, $listener)
{
foreach ((array) $events as $event) {
- if (strpos($event, '*') !== false) {
+ if (str_contains((string) $event, '*')) {
$this->setupWildcardListen($event, $listener);
} else {
$this->listeners[$event][] = $this->makeListener($listener);
@@ -57,9 +57,8 @@ class Dispatcher implements DispatcherInterface
/**
* Setup a wildcard listener callback.
*
- * @param string $event
- * @param mixed $listener
- *
+ * @param string $event
+ * @param mixed $listener
* @return void
*/
protected function setupWildcardListen($event, $listener)
@@ -134,9 +133,8 @@ class Dispatcher implements DispatcherInterface
/**
* Parse the given event and payload and prepare them for dispatching.
*
- * @param mixed $event
- * @param mixed $payload
- *
+ * @param mixed $event
+ * @param mixed $payload
* @return array
*/
protected function parseEventAndPayload($event, $payload)
@@ -168,8 +166,7 @@ class Dispatcher implements DispatcherInterface
/**
* Get the wildcard listeners for the event.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return array
*/
protected function getWildcardListeners($eventName)
@@ -190,9 +187,8 @@ class Dispatcher implements DispatcherInterface
*
* This function is a direct excerpt from Laravel's Str::is().
*
- * @param string $wildcard
- * @param string $eventName
- *
+ * @param string $wildcard
+ * @param string $eventName
* @return bool
*/
protected function wildcardContainsEvent($wildcard, $eventName)
@@ -229,9 +225,8 @@ class Dispatcher implements DispatcherInterface
/**
* Add the listeners for the event's interfaces to the given array.
*
- * @param string $eventName
- * @param array $listeners
- *
+ * @param string $eventName
+ * @param array $listeners
* @return array
*/
protected function addInterfaceListeners($eventName, array $listeners = [])
@@ -250,9 +245,8 @@ class Dispatcher implements DispatcherInterface
/**
* Register an event listener with the dispatcher.
*
- * @param \Closure|string $listener
- * @param bool $wildcard
- *
+ * @param \Closure|string $listener
+ * @param bool $wildcard
* @return \Closure
*/
public function makeListener($listener, $wildcard = false)
@@ -273,9 +267,8 @@ class Dispatcher implements DispatcherInterface
/**
* Create a class based listener.
*
- * @param string $listener
- * @param bool $wildcard
- *
+ * @param string $listener
+ * @param bool $wildcard
* @return \Closure
*/
protected function createClassListener($listener, $wildcard = false)
@@ -295,8 +288,7 @@ class Dispatcher implements DispatcherInterface
/**
* Create the class based event callable.
*
- * @param string $listener
- *
+ * @param string $listener
* @return callable
*/
protected function createClassCallable($listener)
@@ -309,13 +301,12 @@ class Dispatcher implements DispatcherInterface
/**
* Parse the class listener into class and method.
*
- * @param string $listener
- *
+ * @param string $listener
* @return array
*/
protected function parseListenerCallback($listener)
{
- return strpos($listener, '@') !== false
+ return str_contains((string) $listener, '@')
? explode('@', $listener, 2)
: [$listener, 'handle'];
}
@@ -325,7 +316,7 @@ class Dispatcher implements DispatcherInterface
*/
public function forget($event)
{
- if (strpos($event, '*') !== false) {
+ if (str_contains((string) $event, '*')) {
unset($this->wildcards[$event]);
} else {
unset($this->listeners[$event]);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php
index 6b7cb10c..590328f0 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/DispatcherInterface.php
@@ -7,9 +7,8 @@ interface DispatcherInterface
/**
* Register an event listener with the dispatcher.
*
- * @param string|array $events
- * @param mixed $listener
- *
+ * @param string|array $events
+ * @param mixed $listener
* @return void
*/
public function listen($events, $listener);
@@ -17,8 +16,7 @@ interface DispatcherInterface
/**
* Determine if a given event has listeners.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return bool
*/
public function hasListeners($eventName);
@@ -26,9 +24,8 @@ interface DispatcherInterface
/**
* Fire an event until the first non-null response is returned.
*
- * @param string|object $event
- * @param mixed $payload
- *
+ * @param string|object $event
+ * @param mixed $payload
* @return array|null
*/
public function until($event, $payload = []);
@@ -36,10 +33,9 @@ interface DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return mixed
*/
public function fire($event, $payload = [], $halt = false);
@@ -47,10 +43,9 @@ interface DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return array|null
*/
public function dispatch($event, $payload = [], $halt = false);
@@ -58,8 +53,7 @@ interface DispatcherInterface
/**
* Get all of the listeners for a given event name.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return array
*/
public function getListeners($eventName);
@@ -67,8 +61,7 @@ interface DispatcherInterface
/**
* Remove a set of listeners from the dispatcher.
*
- * @param string $event
- *
+ * @param string $event
* @return void
*/
public function forget($event);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php
index b2082e59..b8a84916 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/Logger.php
@@ -21,7 +21,7 @@ class Logger
/**
* Constructor.
*
- * @param LoggerInterface|null $logger
+ * @param LoggerInterface|null $logger
*/
public function __construct(LoggerInterface $logger = null)
{
@@ -31,8 +31,7 @@ class Logger
/**
* Logs the given event.
*
- * @param mixed $event
- *
+ * @param mixed $event
* @return void
*/
public function log($event)
@@ -53,8 +52,7 @@ class Logger
/**
* Logs an authentication event.
*
- * @param AuthEvent $event
- *
+ * @param AuthEvent $event
* @return void
*/
public function auth(AuthEvent $event)
@@ -81,8 +79,7 @@ class Logger
/**
* Logs a model event.
*
- * @param ModelEvent $event
- *
+ * @param ModelEvent $event
* @return void
*/
public function model(ModelEvent $event)
@@ -106,8 +103,7 @@ class Logger
/**
* Logs a query event.
*
- * @param QueryEvent $event
- *
+ * @param QueryEvent $event
* @return void
*/
public function query(QueryEvent $event)
@@ -133,8 +129,7 @@ class Logger
/**
* Returns the operational name of the given event.
*
- * @param mixed $event
- *
+ * @param mixed $event
* @return string
*/
protected function getOperationName($event)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php
index 73b1f5a8..7683d1f8 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Events/NullDispatcher.php
@@ -14,7 +14,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Constructor.
*
- * @param DispatcherInterface $dispatcher
+ * @param DispatcherInterface $dispatcher
*/
public function __construct(DispatcherInterface $dispatcher)
{
@@ -24,9 +24,8 @@ class NullDispatcher implements DispatcherInterface
/**
* Register an event listener with the dispatcher.
*
- * @param string|array $events
- * @param mixed $listener
- *
+ * @param string|array $events
+ * @param mixed $listener
* @return void
*/
public function listen($events, $listener)
@@ -37,8 +36,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Determine if a given event has listeners.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return bool
*/
public function hasListeners($eventName)
@@ -49,9 +47,8 @@ class NullDispatcher implements DispatcherInterface
/**
* Fire an event until the first non-null response is returned.
*
- * @param string|object $event
- * @param mixed $payload
- *
+ * @param string|object $event
+ * @param mixed $payload
* @return null
*/
public function until($event, $payload = [])
@@ -62,10 +59,9 @@ class NullDispatcher implements DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return null
*/
public function fire($event, $payload = [], $halt = false)
@@ -76,10 +72,9 @@ class NullDispatcher implements DispatcherInterface
/**
* Fire an event and call the listeners.
*
- * @param string|object $event
- * @param mixed $payload
- * @param bool $halt
- *
+ * @param string|object $event
+ * @param mixed $payload
+ * @param bool $halt
* @return null
*/
public function dispatch($event, $payload = [], $halt = false)
@@ -90,8 +85,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Get all of the listeners for a given event name.
*
- * @param string $eventName
- *
+ * @param string $eventName
* @return array
*/
public function getListeners($eventName)
@@ -102,8 +96,7 @@ class NullDispatcher implements DispatcherInterface
/**
* Remove a set of listeners from the dispatcher.
*
- * @param string $event
- *
+ * @param string $event
* @return void
*/
public function forget($event)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php
index 9af7ad75..4a2e2759 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/HandlesConnection.php
@@ -148,8 +148,7 @@ trait HandlesConnection
/**
* Convert warnings to exceptions for the given operation.
*
- * @param Closure $operation
- *
+ * @param Closure $operation
* @return mixed
*
* @throws LdapRecordException
@@ -190,8 +189,7 @@ trait HandlesConnection
/**
* Determine if the failed operation should be bypassed.
*
- * @param string $method
- *
+ * @param string $method
* @return bool
*/
protected function shouldBypassFailure($method)
@@ -202,8 +200,7 @@ trait HandlesConnection
/**
* Determine if the error should be bypassed.
*
- * @param string $error
- *
+ * @param string $error
* @return bool
*/
protected function shouldBypassError($error)
@@ -226,9 +223,8 @@ trait HandlesConnection
/**
* Generates an LDAP connection string for each host given.
*
- * @param string|array $hosts
- * @param string $port
- *
+ * @param string|array $hosts
+ * @param string $port
* @return string
*/
protected function makeConnectionUris($hosts, $port)
@@ -249,9 +245,8 @@ trait HandlesConnection
/**
* Assemble the host URI strings.
*
- * @param array|string $hosts
- * @param string $port
- *
+ * @param array|string $hosts
+ * @param string $port
* @return array
*/
protected function assembleHostUris($hosts, $port)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php
index 0c3574f1..76c37204 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Ldap.php
@@ -4,7 +4,6 @@ namespace LdapRecord;
use LDAP\Connection as RawLdapConnection;
-/** @psalm-suppress UndefinedClass */
class Ldap implements LdapInterface
{
use HandlesConnection, DetectsErrors;
@@ -24,8 +23,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-first-entry.php
*
- * @param resource $searchResults
- *
+ * @param resource $searchResults
* @return resource
*/
public function getFirstEntry($searchResults)
@@ -40,8 +38,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-next-entry.php
*
- * @param resource $entry
- *
+ * @param resource $entry
* @return resource
*/
public function getNextEntry($entry)
@@ -56,8 +53,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-get-attributes.php
*
- * @param resource $entry
- *
+ * @param resource $entry
* @return array|false
*/
public function getAttributes($entry)
@@ -72,8 +68,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-count-entries.php
*
- * @param resource $searchResults
- *
+ * @param resource $searchResults
* @return int
*/
public function countEntries($searchResults)
@@ -88,10 +83,9 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-compare.php
*
- * @param string $dn
- * @param string $attribute
- * @param string $value
- *
+ * @param string $dn
+ * @param string $attribute
+ * @param string $value
* @return mixed
*/
public function compare($dn, $attribute, $value)
@@ -132,9 +126,8 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-get-values-len.php
*
- * @param $entry
- * @param $attribute
- *
+ * @param $entry
+ * @param $attribute
* @return array
*/
public function getValuesLen($entry, $attribute)
@@ -167,8 +160,7 @@ class Ldap implements LdapInterface
*
* @see http://php.net/manual/en/function.ldap-set-rebind-proc.php
*
- * @param callable $callback
- *
+ * @param callable $callback
* @return bool
*/
public function setRebindCallback(callable $callback)
@@ -304,7 +296,7 @@ class Ldap implements LdapInterface
public function bind($username, $password)
{
return $this->bound = $this->executeFailableOperation(function () use ($username, $password) {
- return ldap_bind($this->connection, $username, html_entity_decode($password));
+ return ldap_bind($this->connection, $username, $password ? html_entity_decode($password) : null);
});
}
@@ -462,8 +454,7 @@ class Ldap implements LdapInterface
/**
* Extract the diagnostic code from the message.
*
- * @param string $message
- *
+ * @param string $message
* @return string|bool
*/
public function extractDiagnosticCode($message)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php
index c74fe4e8..fcff57f4 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapInterface.php
@@ -9,28 +9,28 @@ interface LdapInterface
*
* @var string
*/
- const PROTOCOL_SSL = 'ldaps://';
+ public const PROTOCOL_SSL = 'ldaps://';
/**
* The standard LDAP protocol string.
*
* @var string
*/
- const PROTOCOL = 'ldap://';
+ public const PROTOCOL = 'ldap://';
/**
* The LDAP SSL port number.
*
* @var string
*/
- const PORT_SSL = 636;
+ public const PORT_SSL = 636;
/**
* The standard LDAP port number.
*
* @var string
*/
- const PORT = 389;
+ public const PORT = 389;
/**
* Various useful server control OID's.
@@ -38,37 +38,36 @@ interface LdapInterface
* @see https://ldap.com/ldap-oid-reference-guide/
* @see http://msdn.microsoft.com/en-us/library/cc223359.aspx
*/
- const OID_SERVER_START_TLS = '1.3.6.1.4.1.1466.20037';
- const OID_SERVER_PAGED_RESULTS = '1.2.840.113556.1.4.319';
- const OID_SERVER_SHOW_DELETED = '1.2.840.113556.1.4.417';
- const OID_SERVER_SORT = '1.2.840.113556.1.4.473';
- const OID_SERVER_CROSSDOM_MOVE_TARGET = '1.2.840.113556.1.4.521';
- const OID_SERVER_NOTIFICATION = '1.2.840.113556.1.4.528';
- const OID_SERVER_EXTENDED_DN = '1.2.840.113556.1.4.529';
- const OID_SERVER_LAZY_COMMIT = '1.2.840.113556.1.4.619';
- const OID_SERVER_SD_FLAGS = '1.2.840.113556.1.4.801';
- const OID_SERVER_TREE_DELETE = '1.2.840.113556.1.4.805';
- const OID_SERVER_DIRSYNC = '1.2.840.113556.1.4.841';
- const OID_SERVER_VERIFY_NAME = '1.2.840.113556.1.4.1338';
- const OID_SERVER_DOMAIN_SCOPE = '1.2.840.113556.1.4.1339';
- const OID_SERVER_SEARCH_OPTIONS = '1.2.840.113556.1.4.1340';
- const OID_SERVER_PERMISSIVE_MODIFY = '1.2.840.113556.1.4.1413';
- const OID_SERVER_ASQ = '1.2.840.113556.1.4.1504';
- const OID_SERVER_FAST_BIND = '1.2.840.113556.1.4.1781';
- const OID_SERVER_CONTROL_VLVREQUEST = '2.16.840.1.113730.3.4.9';
+ public const OID_SERVER_START_TLS = '1.3.6.1.4.1.1466.20037';
+ public const OID_SERVER_PAGED_RESULTS = '1.2.840.113556.1.4.319';
+ public const OID_SERVER_SHOW_DELETED = '1.2.840.113556.1.4.417';
+ public const OID_SERVER_SORT = '1.2.840.113556.1.4.473';
+ public const OID_SERVER_CROSSDOM_MOVE_TARGET = '1.2.840.113556.1.4.521';
+ public const OID_SERVER_NOTIFICATION = '1.2.840.113556.1.4.528';
+ public const OID_SERVER_EXTENDED_DN = '1.2.840.113556.1.4.529';
+ public const OID_SERVER_LAZY_COMMIT = '1.2.840.113556.1.4.619';
+ public const OID_SERVER_SD_FLAGS = '1.2.840.113556.1.4.801';
+ public const OID_SERVER_TREE_DELETE = '1.2.840.113556.1.4.805';
+ public const OID_SERVER_DIRSYNC = '1.2.840.113556.1.4.841';
+ public const OID_SERVER_VERIFY_NAME = '1.2.840.113556.1.4.1338';
+ public const OID_SERVER_DOMAIN_SCOPE = '1.2.840.113556.1.4.1339';
+ public const OID_SERVER_SEARCH_OPTIONS = '1.2.840.113556.1.4.1340';
+ public const OID_SERVER_PERMISSIVE_MODIFY = '1.2.840.113556.1.4.1413';
+ public const OID_SERVER_ASQ = '1.2.840.113556.1.4.1504';
+ public const OID_SERVER_FAST_BIND = '1.2.840.113556.1.4.1781';
+ public const OID_SERVER_CONTROL_VLVREQUEST = '2.16.840.1.113730.3.4.9';
/**
* Query OID's.
*
* @see https://ldapwiki.com/wiki/LDAP_MATCHING_RULE_IN_CHAIN
*/
- const OID_MATCHING_RULE_IN_CHAIN = '1.2.840.113556.1.4.1941';
+ public const OID_MATCHING_RULE_IN_CHAIN = '1.2.840.113556.1.4.1941';
/**
* Set the current connection to use SSL.
*
- * @param bool $enabled
- *
+ * @param bool $enabled
* @return $this
*/
public function ssl();
@@ -83,8 +82,7 @@ interface LdapInterface
/**
* Set the current connection to use TLS.
*
- * @param bool $enabled
- *
+ * @param bool $enabled
* @return $this
*/
public function tls();
@@ -138,8 +136,7 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-get-entries.php
*
- * @param resource $searchResults
- *
+ * @param resource $searchResults
* @return array
*/
public function getEntries($searchResults);
@@ -169,9 +166,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-set-option.php
*
- * @param int $option
- * @param mixed $value
- *
+ * @param int $option
+ * @param mixed $value
* @return bool
*/
public function setOption($option, $value);
@@ -179,8 +175,7 @@ interface LdapInterface
/**
* Set options on the current connection.
*
- * @param array $options
- *
+ * @param array $options
* @return void
*/
public function setOptions(array $options = []);
@@ -190,9 +185,8 @@ interface LdapInterface
*
* @see https://www.php.net/manual/en/function.ldap-get-option.php
*
- * @param int $option
- * @param mixed $value
- *
+ * @param int $option
+ * @param mixed $value
* @return mixed
*/
public function getOption($option, &$value = null);
@@ -213,9 +207,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-start-tls.php
*
- * @param string|array $hosts
- * @param int $port
- *
+ * @param string|array $hosts
+ * @param int $port
* @return resource|false
*/
public function connect($hosts = [], $port = 389);
@@ -236,15 +229,14 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-search.php
*
- * @param string $dn
- * @param string $filter
- * @param array $fields
- * @param bool $onlyAttributes
- * @param int $size
- * @param int $time
- * @param int $deref
- * @param array $serverControls
- *
+ * @param string $dn
+ * @param string $filter
+ * @param array $fields
+ * @param bool $onlyAttributes
+ * @param int $size
+ * @param int $time
+ * @param int $deref
+ * @param array $serverControls
* @return resource
*/
public function search($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []);
@@ -254,15 +246,14 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-list.php
*
- * @param string $dn
- * @param string $filter
- * @param array $fields
- * @param bool $onlyAttributes
- * @param int $size
- * @param int $time
- * @param int $deref
- * @param array $serverControls
- *
+ * @param string $dn
+ * @param string $filter
+ * @param array $fields
+ * @param bool $onlyAttributes
+ * @param int $size
+ * @param int $time
+ * @param int $deref
+ * @param array $serverControls
* @return resource
*/
public function listing($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []);
@@ -272,15 +263,14 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-read.php
*
- * @param string $dn
- * @param string $filter
- * @param array $fields
- * @param bool $onlyAttributes
- * @param int $size
- * @param int $time
- * @param int $deref
- * @param array $serverControls
- *
+ * @param string $dn
+ * @param string $filter
+ * @param array $fields
+ * @param bool $onlyAttributes
+ * @param int $size
+ * @param int $time
+ * @param int $deref
+ * @param array $serverControls
* @return resource
*/
public function read($dn, $filter, array $fields, $onlyAttributes = false, $size = 0, $time = 0, $deref = LDAP_DEREF_NEVER, $serverControls = []);
@@ -290,13 +280,12 @@ interface LdapInterface
*
* @see https://www.php.net/manual/en/function.ldap-parse-result.php
*
- * @param resource $result
- * @param int $errorCode
- * @param ?string $dn
- * @param ?string $errorMessage
- * @param ?array $referrals
- * @param ?array $serverControls
- *
+ * @param resource $result
+ * @param int $errorCode
+ * @param ?string $dn
+ * @param ?string $errorMessage
+ * @param ?array $referrals
+ * @param ?array $serverControls
* @return bool
*/
public function parseResult($result, &$errorCode, &$dn, &$errorMessage, &$referrals, &$serverControls = []);
@@ -307,9 +296,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-bind.php
*
- * @param string $username
- * @param string $password
- *
+ * @param string $username
+ * @param string $password
* @return bool
*
* @throws LdapRecordException
@@ -321,9 +309,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-add.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -335,8 +322,7 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-delete.php
*
- * @param string $dn
- *
+ * @param string $dn
* @return bool
*
* @throws LdapRecordException
@@ -348,11 +334,10 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-rename.php
*
- * @param string $dn
- * @param string $newRdn
- * @param string $newParent
- * @param bool $deleteOldRdn
- *
+ * @param string $dn
+ * @param string $newRdn
+ * @param string $newParent
+ * @param bool $deleteOldRdn
* @return bool
*
* @throws LdapRecordException
@@ -364,9 +349,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-modify.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -378,9 +362,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-modify-batch.php
*
- * @param string $dn
- * @param array $values
- *
+ * @param string $dn
+ * @param array $values
* @return bool
*
* @throws LdapRecordException
@@ -392,9 +375,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-mod-add.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -406,9 +388,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-mod-replace.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -420,9 +401,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-mod-del.php
*
- * @param string $dn
- * @param array $entry
- *
+ * @param string $dn
+ * @param array $entry
* @return bool
*
* @throws LdapRecordException
@@ -434,10 +414,9 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-control-paged-result.php
*
- * @param int $pageSize
- * @param bool $isCritical
- * @param string $cookie
- *
+ * @param int $pageSize
+ * @param bool $isCritical
+ * @param string $cookie
* @return bool
*/
public function controlPagedResult($pageSize = 1000, $isCritical = false, $cookie = '');
@@ -447,9 +426,8 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-control-paged-result-response.php
*
- * @param resource $result
- * @param string $cookie
- *
+ * @param resource $result
+ * @param string $cookie
* @return bool
*/
public function controlPagedResultResponse($result, &$cookie);
@@ -459,8 +437,7 @@ interface LdapInterface
*
* @see https://www.php.net/manual/en/function.ldap-free-result.php
*
- * @param resource $result
- *
+ * @param resource $result
* @return bool
*/
public function freeResult($result);
@@ -479,8 +456,7 @@ interface LdapInterface
*
* @see http://php.net/manual/en/function.ldap-err2str.php
*
- * @param int $number
- *
+ * @param int $number
* @return string
*/
public function err2Str($number);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php
index b2439bf8..0669b4c6 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/LdapRecordException.php
@@ -16,9 +16,8 @@ class LdapRecordException extends Exception
/**
* Create a new Bind Exception with a detailed connection error.
*
- * @param Exception $e
- * @param DetailedError|null $error
- *
+ * @param Exception $e
+ * @param DetailedError|null $error
* @return $this
*/
public static function withDetailedError(Exception $e, DetailedError $error = null)
@@ -29,8 +28,7 @@ class LdapRecordException extends Exception
/**
* Set the detailed error.
*
- * @param DetailedError|null $error
- *
+ * @param DetailedError|null $error
* @return $this
*/
public function setDetailedError(DetailedError $error = null)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php
index 97fd3a1f..b7138d30 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Concerns/HasPrimaryGroup.php
@@ -9,10 +9,9 @@ trait HasPrimaryGroup
/**
* Returns a new has one primary group relationship.
*
- * @param mixed $related
- * @param string $relationKey
- * @param string $foreignKey
- *
+ * @param mixed $related
+ * @param string $relationKey
+ * @param string $foreignKey
* @return HasOnePrimaryGroup
*/
public function hasOnePrimaryGroup($related, $relationKey, $foreignKey = 'primarygroupid')
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php
index 652ad563..e1a0233c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Entry.php
@@ -9,6 +9,7 @@ use LdapRecord\Models\Entry as BaseEntry;
use LdapRecord\Models\Events\Updated;
use LdapRecord\Models\Types\ActiveDirectory;
use LdapRecord\Query\Model\ActiveDirectoryBuilder;
+use LdapRecord\Support\Arr;
/** @mixin ActiveDirectoryBuilder */
class Entry extends BaseEntry implements ActiveDirectory
@@ -50,20 +51,46 @@ class Entry extends BaseEntry implements ActiveDirectory
/**
* @inheritdoc
*/
- public function getConvertedSid()
+ public function getConvertedSid($sid = null)
{
try {
- return (string) new Sid($this->getObjectSid());
+ return (string) $this->newObjectSid(
+ $sid ?? $this->getObjectSid()
+ );
} catch (InvalidArgumentException $e) {
return;
}
}
/**
- * Create a new query builder.
+ * @inheritdoc
+ */
+ public function getBinarySid($sid = null)
+ {
+ try {
+ return $this->newObjectSid(
+ $sid ?? $this->getObjectSid()
+ )->getBinary();
+ } catch (InvalidArgumentException $e) {
+ return;
+ }
+ }
+
+ /**
+ * Make a new object Sid instance.
*
- * @param Connection $connection
+ * @param string $value
+ * @return Sid
+ */
+ protected function newObjectSid($value)
+ {
+ return new Sid($value);
+ }
+
+ /**
+ * Create a new query builder.
*
+ * @param Connection $connection
* @return ActiveDirectoryBuilder
*/
public function newQueryBuilder(Connection $connection)
@@ -84,8 +111,7 @@ class Entry extends BaseEntry implements ActiveDirectory
/**
* Restore a deleted object.
*
- * @param string|null $newParentDn
- *
+ * @param string|null $newParentDn
* @return bool
*
* @throws \LdapRecord\LdapRecordException
@@ -114,24 +140,6 @@ class Entry extends BaseEntry implements ActiveDirectory
$this->save(['isDeleted' => null]);
}
- /**
- * Get the RootDSE (AD schema) record from the directory.
- *
- * @param string|null $connection
- *
- * @return static
- *
- * @throws \LdapRecord\Models\ModelNotFoundException
- */
- public static function getRootDse($connection = null)
- {
- return static::on($connection ?? (new static())->getConnectionName())
- ->in(null)
- ->read()
- ->whereHas('objectclass')
- ->firstOrFail();
- }
-
/**
* Get the objects restore location.
*
@@ -143,22 +151,50 @@ class Entry extends BaseEntry implements ActiveDirectory
}
/**
- * Converts attributes for JSON serialization.
- *
- * @param array $attributes
+ * Convert the attributes for JSON serialization.
*
+ * @param array $attributes
* @return array
*/
protected function convertAttributesForJson(array $attributes = [])
{
$attributes = parent::convertAttributesForJson($attributes);
- if ($this->hasAttribute($this->sidKey)) {
- // If the model has a SID set, we need to convert it due to it being in
- // binary. Otherwise we will receive a JSON serialization exception.
- return array_replace($attributes, [
- $this->sidKey => [$this->getConvertedSid()],
- ]);
+ // If the model has a SID set, we need to convert it to its
+ // string format, due to it being in binary. Otherwise
+ // we will receive a JSON serialization exception.
+ if (isset($attributes[$this->sidKey])) {
+ $attributes[$this->sidKey] = [$this->getConvertedSid(
+ Arr::first($attributes[$this->sidKey])
+ )];
+ }
+
+ return $attributes;
+ }
+
+ /**
+ * Convert the attributes from JSON serialization.
+ *
+ * @param array $attributes
+ * @return array
+ */
+ protected function convertAttributesFromJson(array $attributes = [])
+ {
+ $attributes = parent::convertAttributesFromJson($attributes);
+
+ // Here we are converting the model's GUID and SID attributes
+ // back to their original values from serialization, so that
+ // their original value may be used and compared against.
+ if (isset($attributes[$this->guidKey])) {
+ $attributes[$this->guidKey] = [$this->getBinaryGuid(
+ Arr::first($attributes[$this->guidKey])
+ )];
+ }
+
+ if (isset($attributes[$this->sidKey])) {
+ $attributes[$this->sidKey] = [$this->getBinarySid(
+ Arr::first($attributes[$this->sidKey])
+ )];
}
return $attributes;
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php
index 540ec771..40350c97 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Relations/HasOnePrimaryGroup.php
@@ -10,8 +10,7 @@ class HasOnePrimaryGroup extends HasOne
/**
* Get the foreign model by the given value.
*
- * @param string $value
- *
+ * @param string $value
* @return Model|null
*/
protected function getForeignModelByValue($value)
@@ -26,8 +25,7 @@ class HasOnePrimaryGroup extends HasOne
*
* Retrieves the last RID from the models Object SID.
*
- * @param Model $model
- *
+ * @param Model $model
* @return string
*/
protected function getForeignValueFromModel(Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php
index cd08648d..76df79ca 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/HasServerRoleAttribute.php
@@ -11,9 +11,8 @@ class HasServerRoleAttribute implements Scope
/**
* Includes condition of having a serverRole attribute.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php
index 9f2fbe4d..dc8a4d21 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/InConfigurationContext.php
@@ -12,9 +12,8 @@ class InConfigurationContext implements Scope
/**
* Refines the base dn to be inside the configuration context.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*
* @throws \LdapRecord\Models\ModelNotFoundException
@@ -27,8 +26,7 @@ class InConfigurationContext implements Scope
/**
* Get the LDAP server configuration naming context distinguished name.
*
- * @param Model $model
- *
+ * @param Model $model
* @return mixed
*
* @throws \LdapRecord\Models\ModelNotFoundException
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php
index a616db1c..9d00cf8f 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/Scopes/RejectComputerObjectClass.php
@@ -11,9 +11,8 @@ class RejectComputerObjectClass implements Scope
/**
* Prevent computer objects from being included in results.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php
index b735b03b..c2ea0325 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ActiveDirectory/User.php
@@ -6,6 +6,7 @@ use Carbon\Carbon;
use Illuminate\Contracts\Auth\Authenticatable;
use LdapRecord\Models\ActiveDirectory\Concerns\HasPrimaryGroup;
use LdapRecord\Models\ActiveDirectory\Scopes\RejectComputerObjectClass;
+use LdapRecord\Models\Attributes\AccountControl;
use LdapRecord\Models\Concerns\CanAuthenticate;
use LdapRecord\Models\Concerns\HasPassword;
use LdapRecord\Query\Model\Builder;
@@ -71,6 +72,38 @@ class User extends Entry implements Authenticatable
static::addGlobalScope(new RejectComputerObjectClass());
}
+ /**
+ * Determine if the user's account is enabled.
+ *
+ * @return bool
+ */
+ public function isEnabled()
+ {
+ return ! $this->isDisabled();
+ }
+
+ /**
+ * Determine if the user's account is disabled.
+ *
+ * @return bool
+ */
+ public function isDisabled()
+ {
+ return $this->accountControl()->has(AccountControl::ACCOUNTDISABLE);
+ }
+
+ /**
+ * Get the user's account control.
+ *
+ * @return AccountControl
+ */
+ public function accountControl()
+ {
+ return new AccountControl(
+ $this->getFirstAttribute('userAccountControl')
+ );
+ }
+
/**
* The groups relationship.
*
@@ -110,8 +143,7 @@ class User extends Entry implements Authenticatable
/**
* Scopes the query to exchange mailbox users.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return Builder
*/
public function scopeWhereHasMailbox(Builder $query)
@@ -122,8 +154,7 @@ class User extends Entry implements Authenticatable
/**
* Scopes the query to users having a lockout value set.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return Builder
*/
public function scopeWhereHasLockout(Builder $query)
@@ -137,9 +168,8 @@ class User extends Entry implements Authenticatable
* @see https://ldapwiki.com/wiki/Active%20Directory%20Account%20Lockout
* @see https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/account-lockout-duration
*
- * @param string|int $localTimezone
- * @param int|null $durationInMinutes
- *
+ * @param string|int $localTimezone
+ * @param int|null $durationInMinutes
* @return bool
*/
public function isLockedOut($localTimezone, $durationInMinutes = null)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php
index 7e241462..45fae214 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/AccountControl.php
@@ -6,49 +6,49 @@ use ReflectionClass;
class AccountControl
{
- const SCRIPT = 1;
+ public const SCRIPT = 1;
- const ACCOUNTDISABLE = 2;
+ public const ACCOUNTDISABLE = 2;
- const HOMEDIR_REQUIRED = 8;
+ public const HOMEDIR_REQUIRED = 8;
- const LOCKOUT = 16;
+ public const LOCKOUT = 16;
- const PASSWD_NOTREQD = 32;
+ public const PASSWD_NOTREQD = 32;
- const PASSWD_CANT_CHANGE = 64;
+ public const PASSWD_CANT_CHANGE = 64;
- const ENCRYPTED_TEXT_PWD_ALLOWED = 128;
+ public const ENCRYPTED_TEXT_PWD_ALLOWED = 128;
- const TEMP_DUPLICATE_ACCOUNT = 256;
+ public const TEMP_DUPLICATE_ACCOUNT = 256;
- const NORMAL_ACCOUNT = 512;
+ public const NORMAL_ACCOUNT = 512;
- const INTERDOMAIN_TRUST_ACCOUNT = 2048;
+ public const INTERDOMAIN_TRUST_ACCOUNT = 2048;
- const WORKSTATION_TRUST_ACCOUNT = 4096;
+ public const WORKSTATION_TRUST_ACCOUNT = 4096;
- const SERVER_TRUST_ACCOUNT = 8192;
+ public const SERVER_TRUST_ACCOUNT = 8192;
- const DONT_EXPIRE_PASSWORD = 65536;
+ public const DONT_EXPIRE_PASSWORD = 65536;
- const MNS_LOGON_ACCOUNT = 131072;
+ public const MNS_LOGON_ACCOUNT = 131072;
- const SMARTCARD_REQUIRED = 262144;
+ public const SMARTCARD_REQUIRED = 262144;
- const TRUSTED_FOR_DELEGATION = 524288;
+ public const TRUSTED_FOR_DELEGATION = 524288;
- const NOT_DELEGATED = 1048576;
+ public const NOT_DELEGATED = 1048576;
- const USE_DES_KEY_ONLY = 2097152;
+ public const USE_DES_KEY_ONLY = 2097152;
- const DONT_REQ_PREAUTH = 4194304;
+ public const DONT_REQ_PREAUTH = 4194304;
- const PASSWORD_EXPIRED = 8388608;
+ public const PASSWORD_EXPIRED = 8388608;
- const TRUSTED_TO_AUTH_FOR_DELEGATION = 16777216;
+ public const TRUSTED_TO_AUTH_FOR_DELEGATION = 16777216;
- const PARTIAL_SECRETS_ACCOUNT = 67108864;
+ public const PARTIAL_SECRETS_ACCOUNT = 67108864;
/**
* The account control flag values.
@@ -60,7 +60,7 @@ class AccountControl
/**
* Constructor.
*
- * @param ?int $flag
+ * @param ?int $flag
*/
public function __construct($flag = null)
{
@@ -92,8 +92,7 @@ class AccountControl
/**
* Add the flag to the account control values.
*
- * @param int $flag
- *
+ * @param int $flag
* @return $this
*/
public function add($flag)
@@ -108,8 +107,7 @@ class AccountControl
/**
* Remove the flag from the account control.
*
- * @param int $flag
- *
+ * @param int $flag
* @return $this
*/
public function remove($flag)
@@ -122,8 +120,7 @@ class AccountControl
/**
* Extract and apply the flag.
*
- * @param int $flag
- *
+ * @param int $flag
* @return void
*/
public function apply($flag)
@@ -134,8 +131,7 @@ class AccountControl
/**
* Determine if the account control contains the given UAC flag(s).
*
- * @param int $flag
- *
+ * @param int $flag
* @return bool
*/
public function has($flag)
@@ -154,8 +150,7 @@ class AccountControl
/**
* Determine if the account control does not contain the given UAC flag(s).
*
- * @param int $flag
- *
+ * @param int $flag
* @return bool
*/
public function doesntHave($flag)
@@ -441,8 +436,7 @@ class AccountControl
/**
* Set the account control values.
*
- * @param array<int, int> $flags
- *
+ * @param array<int, int> $flags
* @return void
*/
public function setValues(array $flags)
@@ -483,8 +477,7 @@ class AccountControl
/**
* Extracts the given flag into an array of flags used.
*
- * @param int $flag
- *
+ * @param int $flag
* @return array
*/
public function extractFlags($flag)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php
index c6977a8e..fc981299 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedName.php
@@ -19,7 +19,7 @@ class DistinguishedName
/**
* Constructor.
*
- * @param string|null $value
+ * @param string|null $value
*/
public function __construct($value = null)
{
@@ -39,8 +39,7 @@ class DistinguishedName
/**
* Alias of the "build" method.
*
- * @param string|null $value
- *
+ * @param string|null $value
* @return DistinguishedNameBuilder
*/
public static function of($value = null)
@@ -51,8 +50,7 @@ class DistinguishedName
/**
* Get a new DN builder object from the given DN.
*
- * @param string|null $value
- *
+ * @param string|null $value
* @return DistinguishedNameBuilder
*/
public static function build($value = null)
@@ -63,8 +61,7 @@ class DistinguishedName
/**
* Make a new distinguished name instance.
*
- * @param string|null $value
- *
+ * @param string|null $value
* @return static
*/
public static function make($value = null)
@@ -75,8 +72,7 @@ class DistinguishedName
/**
* Determine if the given value is a valid distinguished name.
*
- * @param string $value
- *
+ * @param string $value
* @return bool
*/
public static function isValid($value)
@@ -87,8 +83,7 @@ class DistinguishedName
/**
* Explode a distinguished name into relative distinguished names.
*
- * @param string $dn
- *
+ * @param string $dn
* @return array
*/
public static function explode($dn)
@@ -111,8 +106,7 @@ class DistinguishedName
/**
* Un-escapes a hexadecimal string into its original string representation.
*
- * @param string $value
- *
+ * @param string $value
* @return string
*/
public static function unescape($value)
@@ -125,8 +119,7 @@ class DistinguishedName
/**
* Explode the RDN into an attribute and value.
*
- * @param string $rdn
- *
+ * @param string $rdn
* @return array
*/
public static function explodeRdn($rdn)
@@ -137,8 +130,7 @@ class DistinguishedName
/**
* Implode the component attribute and value into an RDN.
*
- * @param string $rdn
- *
+ * @param string $rdn
* @return string
*/
public static function makeRdn(array $component)
@@ -159,8 +151,7 @@ class DistinguishedName
/**
* Set the underlying value.
*
- * @param string|null $value
- *
+ * @param string|null $value
* @return $this
*/
public function set($value)
@@ -337,8 +328,7 @@ class DistinguishedName
/**
* Determine if the current distinguished name is a parent of the given child.
*
- * @param DistinguishedName $child
- *
+ * @param DistinguishedName $child
* @return bool
*/
public function isParentOf(self $child)
@@ -349,8 +339,7 @@ class DistinguishedName
/**
* Determine if the current distinguished name is a child of the given parent.
*
- * @param DistinguishedName $parent
- *
+ * @param DistinguishedName $parent
* @return bool
*/
public function isChildOf(self $parent)
@@ -370,8 +359,7 @@ class DistinguishedName
/**
* Determine if the current distinguished name is an ancestor of the descendant.
*
- * @param DistinguishedName $descendant
- *
+ * @param DistinguishedName $descendant
* @return bool
*/
public function isAncestorOf(self $descendant)
@@ -382,8 +370,7 @@ class DistinguishedName
/**
* Determine if the current distinguished name is a descendant of the ancestor.
*
- * @param DistinguishedName $ancestor
- *
+ * @param DistinguishedName $ancestor
* @return bool
*/
public function isDescendantOf(self $ancestor)
@@ -407,9 +394,8 @@ class DistinguishedName
/**
* Compare whether the two distinguished name values are equal.
*
- * @param array $values
- * @param array $other
- *
+ * @param array $values
+ * @param array $other
* @return bool
*/
protected function compare(array $values, array $other)
@@ -420,8 +406,7 @@ class DistinguishedName
/**
* Recase the array values.
*
- * @param array $values
- *
+ * @param array $values
* @return array
*/
protected function recase(array $values)
@@ -432,8 +417,7 @@ class DistinguishedName
/**
* Normalize the string value.
*
- * @param string $value
- *
+ * @param string $value
* @return string
*/
protected function normalize($value)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php
index 601902bf..a0d84d82 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/DistinguishedNameBuilder.php
@@ -26,7 +26,7 @@ class DistinguishedNameBuilder
/**
* Constructor.
*
- * @param string|null $value
+ * @param string|null $value
*/
public function __construct($dn = null)
{
@@ -38,9 +38,8 @@ class DistinguishedNameBuilder
/**
* Forward missing method calls onto the Distinguished Name object.
*
- * @param string $method
- * @param array $args
- *
+ * @param string $method
+ * @param array $args
* @return mixed
*/
public function __call($method, $args)
@@ -61,9 +60,8 @@ class DistinguishedNameBuilder
/**
* Prepend an RDN onto the DN.
*
- * @param string|array $attribute
- * @param string|null $value
- *
+ * @param string|array $attribute
+ * @param string|null $value
* @return $this
*/
public function prepend($attribute, $value = null)
@@ -79,9 +77,8 @@ class DistinguishedNameBuilder
/**
* Append an RDN onto the DN.
*
- * @param string|array $attribute
- * @param string|null $value
- *
+ * @param string|array $attribute
+ * @param string|null $value
* @return $this
*/
public function append($attribute, $value = null)
@@ -97,9 +94,8 @@ class DistinguishedNameBuilder
/**
* Componentize the attribute and value.
*
- * @param string|array $attribute
- * @param string|null $value
- *
+ * @param string|array $attribute
+ * @param string|null $value
* @return array
*/
protected function componentize($attribute, $value = null)
@@ -125,8 +121,7 @@ class DistinguishedNameBuilder
/**
* Make a componentized array by exploding the value if it's a string.
*
- * @param string $value
- *
+ * @param string $value
* @return array
*/
protected function makeComponentizedArray($value)
@@ -137,9 +132,8 @@ class DistinguishedNameBuilder
/**
* Make an appendable component array from the attribute and value.
*
- * @param string|array $attribute
- * @param string|null $value
- *
+ * @param string|array $attribute
+ * @param string|null $value
* @return array
*/
protected function makeAppendableComponent($attribute, $value = null)
@@ -150,9 +144,8 @@ class DistinguishedNameBuilder
/**
* Pop an RDN off of the end of the DN.
*
- * @param int $amount
- * @param array $removed
- *
+ * @param int $amount
+ * @param array $removed
* @return $this
*/
public function pop($amount = 1, &$removed = [])
@@ -167,9 +160,8 @@ class DistinguishedNameBuilder
/**
* Shift an RDN off of the beginning of the DN.
*
- * @param int $amount
- * @param array $removed
- *
+ * @param int $amount
+ * @param array $removed
* @return $this
*/
public function shift($amount = 1, &$removed = [])
@@ -196,8 +188,7 @@ class DistinguishedNameBuilder
/**
* Get the components of the DN.
*
- * @param null|string $type
- *
+ * @param null|string $type
* @return array
*/
public function components($type = null)
@@ -210,8 +201,7 @@ class DistinguishedNameBuilder
/**
* Get the components of a particular type.
*
- * @param string $type
- *
+ * @param string $type
* @return array
*/
protected function componentsOfType($type)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php
index 2f611129..3c9d4db0 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/EscapedValue.php
@@ -28,9 +28,9 @@ class EscapedValue
/**
* Constructor.
*
- * @param string $value
- * @param string $ignore
- * @param int $flags
+ * @param string $value
+ * @param string $ignore
+ * @param int $flags
*/
public function __construct($value, $ignore = '', $flags = 0)
{
@@ -72,8 +72,7 @@ class EscapedValue
/**
* Set the characters to exclude from being escaped.
*
- * @param string $characters
- *
+ * @param string $characters
* @return $this
*/
public function ignore($characters)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Guid.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Guid.php
index d139f5f8..e04b5cd3 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Guid.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Guid.php
@@ -50,8 +50,7 @@ class Guid
/**
* Determines if the specified GUID is valid.
*
- * @param string $guid
- *
+ * @param string $guid
* @return bool
*/
public static function isValid($guid)
@@ -62,7 +61,7 @@ class Guid
/**
* Constructor.
*
- * @param mixed $value
+ * @param mixed $value
*
* @throws InvalidArgumentException
*/
@@ -128,8 +127,7 @@ class Guid
/**
* Returns the string variant of a binary GUID.
*
- * @param string $binary
- *
+ * @param string $binary
* @return string|null
*/
protected function binaryGuidToString($binary)
@@ -144,10 +142,9 @@ class Guid
*
* @see https://github.com/ldaptools/ldaptools
*
- * @param string $hex The full hex string.
- * @param array $sections An array of start and length (unless octet is true, then length is always 2).
- * @param bool $octet Whether this is for octet string form.
- *
+ * @param string $hex The full hex string.
+ * @param array $sections An array of start and length (unless octet is true, then length is always 2).
+ * @param bool $octet Whether this is for octet string form.
* @return string The concatenated sections in upper-case.
*/
protected function parseSection($hex, array $sections, $octet = false)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/MbString.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/MbString.php
index 672e60df..72d4c6f4 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/MbString.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/MbString.php
@@ -7,8 +7,7 @@ class MbString
/**
* Get the integer value of a specific character.
*
- * @param $string
- *
+ * @param $string
* @return int
*/
public static function ord($string)
@@ -27,8 +26,7 @@ class MbString
/**
* Get the character for a specific integer value.
*
- * @param $int
- *
+ * @param $int
* @return string
*/
public static function chr($int)
@@ -43,8 +41,7 @@ class MbString
/**
* Split a string into its individual characters and return it as an array.
*
- * @param string $value
- *
+ * @param string $value
* @return string[]
*/
public static function split($value)
@@ -55,8 +52,7 @@ class MbString
/**
* Detects if the given string is UTF 8.
*
- * @param $string
- *
+ * @param $string
* @return string|false
*/
public static function isUtf8($string)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php
index 644f0a8d..d7047a37 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Password.php
@@ -8,15 +8,14 @@ use ReflectionMethod;
class Password
{
- const CRYPT_SALT_TYPE_MD5 = 1;
- const CRYPT_SALT_TYPE_SHA256 = 5;
- const CRYPT_SALT_TYPE_SHA512 = 6;
+ public const CRYPT_SALT_TYPE_MD5 = 1;
+ public const CRYPT_SALT_TYPE_SHA256 = 5;
+ public const CRYPT_SALT_TYPE_SHA512 = 6;
/**
* Make an encoded password for transmission over LDAP.
*
- * @param string $password
- *
+ * @param string $password
* @return string
*/
public static function encode($password)
@@ -27,9 +26,8 @@ class Password
/**
* Make a salted md5 password.
*
- * @param string $password
- * @param null|string $salt
- *
+ * @param string $password
+ * @param null|string $salt
* @return string
*/
public static function smd5($password, $salt = null)
@@ -40,9 +38,8 @@ class Password
/**
* Make a salted SHA password.
*
- * @param string $password
- * @param null|string $salt
- *
+ * @param string $password
+ * @param null|string $salt
* @return string
*/
public static function ssha($password, $salt = null)
@@ -53,9 +50,8 @@ class Password
/**
* Make a salted SSHA256 password.
*
- * @param string $password
- * @param null|string $salt
- *
+ * @param string $password
+ * @param null|string $salt
* @return string
*/
public static function ssha256($password, $salt = null)
@@ -66,9 +62,8 @@ class Password
/**
* Make a salted SSHA384 password.
*
- * @param string $password
- * @param null|string $salt
- *
+ * @param string $password
+ * @param null|string $salt
* @return string
*/
public static function ssha384($password, $salt = null)
@@ -79,9 +74,8 @@ class Password
/**
* Make a salted SSHA512 password.
*
- * @param string $password
- * @param null|string $salt
- *
+ * @param string $password
+ * @param null|string $salt
* @return string
*/
public static function ssha512($password, $salt = null)
@@ -92,8 +86,7 @@ class Password
/**
* Make a non-salted SHA password.
*
- * @param string $password
- *
+ * @param string $password
* @return string
*/
public static function sha($password)
@@ -104,8 +97,7 @@ class Password
/**
* Make a non-salted SHA256 password.
*
- * @param string $password
- *
+ * @param string $password
* @return string
*/
public static function sha256($password)
@@ -116,8 +108,7 @@ class Password
/**
* Make a non-salted SHA384 password.
*
- * @param string $password
- *
+ * @param string $password
* @return string
*/
public static function sha384($password)
@@ -128,8 +119,7 @@ class Password
/**
* Make a non-salted SHA512 password.
*
- * @param string $password
- *
+ * @param string $password
* @return string
*/
public static function sha512($password)
@@ -140,8 +130,7 @@ class Password
/**
* Make a non-salted md5 password.
*
- * @param string $password
- *
+ * @param string $password
* @return string
*/
public static function md5($password)
@@ -150,11 +139,21 @@ class Password
}
/**
- * Crypt password with an MD5 salt.
+ * Make a non-salted NThash password.
*
- * @param string $password
- * @param string $salt
+ * @param string $password
+ * @return string
+ */
+ public static function nthash($password)
+ {
+ return '{NTHASH}'.strtoupper(hash('md4', iconv('UTF-8', 'UTF-16LE', $password)));
+ }
+
+ /**
+ * Crypt password with an MD5 salt.
*
+ * @param string $password
+ * @param string $salt
* @return string
*/
public static function md5Crypt($password, $salt = null)
@@ -165,9 +164,8 @@ class Password
/**
* Crypt password with a SHA256 salt.
*
- * @param string $password
- * @param string $salt
- *
+ * @param string $password
+ * @param string $salt
* @return string
*/
public static function sha256Crypt($password, $salt = null)
@@ -178,9 +176,8 @@ class Password
/**
* Crypt a password with a SHA512 salt.
*
- * @param string $password
- * @param string $salt
- *
+ * @param string $password
+ * @param string $salt
* @return string
*/
public static function sha512Crypt($password, $salt = null)
@@ -191,11 +188,10 @@ class Password
/**
* Make a new password hash.
*
- * @param string $password The password to make a hash of.
- * @param string $method The hash function to use.
- * @param string|null $algo The algorithm to use for hashing.
- * @param string|null $salt The salt to append onto the hash.
- *
+ * @param string $password The password to make a hash of.
+ * @param string $method The hash function to use.
+ * @param string|null $algo The algorithm to use for hashing.
+ * @param string|null $salt The salt to append onto the hash.
* @return string
*/
protected static function makeHash($password, $method, $algo = null, $salt = null)
@@ -208,10 +204,9 @@ class Password
/**
* Make a hashed password.
*
- * @param string $password
- * @param int $type
- * @param null|string $salt
- *
+ * @param string $password
+ * @param int $type
+ * @param null|string $salt
* @return string
*/
protected static function makeCrypt($password, $type, $salt = null)
@@ -222,8 +217,7 @@ class Password
/**
* Make a salt for the crypt() method using the given type.
*
- * @param int $type
- *
+ * @param int $type
* @return string
*/
protected static function makeCryptSalt($type)
@@ -242,8 +236,7 @@ class Password
/**
* Determine the crypt prefix and length.
*
- * @param int $type
- *
+ * @param int $type
* @return array
*
* @throws InvalidArgumentException
@@ -265,8 +258,7 @@ class Password
/**
* Attempt to retrieve the hash method used for the password.
*
- * @param string $password
- *
+ * @param string $password
* @return string|void
*/
public static function getHashMethod($password)
@@ -281,8 +273,7 @@ class Password
/**
* Attempt to retrieve the hash method and algorithm used for the password.
*
- * @param string $password
- *
+ * @param string $password
* @return array|void
*/
public static function getHashMethodAndAlgo($password)
@@ -319,8 +310,7 @@ class Password
/**
* Determine if the hash method requires a salt to be given.
*
- * @param string $method
- *
+ * @param string $method
* @return bool
*
* @throws \ReflectionException
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Sid.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Sid.php
index 4ec46ea7..7760453c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Sid.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Sid.php
@@ -17,8 +17,7 @@ class Sid
/**
* Determines if the specified SID is valid.
*
- * @param string $sid
- *
+ * @param string $sid
* @return bool
*/
public static function isValid($sid)
@@ -29,7 +28,7 @@ class Sid
/**
* Constructor.
*
- * @param mixed $value
+ * @param mixed $value
*
* @throws InvalidArgumentException
*/
@@ -90,8 +89,7 @@ class Sid
/**
* Returns the string variant of a binary SID.
*
- * @param string $binary
- *
+ * @param string $binary
* @return string|null
*/
protected function binarySidToString($binary)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSProperty.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSProperty.php
index ad56aa13..499579f8 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSProperty.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSProperty.php
@@ -7,7 +7,7 @@ class TSProperty
/**
* Nibble control values. The first value for each is if the nibble is <= 9, otherwise the second value is used.
*/
- const NIBBLE_CONTROL = [
+ public const NIBBLE_CONTROL = [
'X' => ['001011', '011010'],
'Y' => ['001110', '011010'],
];
@@ -15,12 +15,12 @@ class TSProperty
/**
* The nibble header.
*/
- const NIBBLE_HEADER = '1110';
+ public const NIBBLE_HEADER = '1110';
/**
* Conversion factor needed for time values in the TSPropertyArray (stored in microseconds).
*/
- const TIME_CONVERSION = 60 * 1000;
+ public const TIME_CONVERSION = 60 * 1000;
/**
* A simple map to help determine how the property needs to be decoded/encoded from/to its binary value.
@@ -85,7 +85,7 @@ class TSProperty
/**
* Pass binary TSProperty data to construct its object representation.
*
- * @param string|null $value
+ * @param string|null $value
*/
public function __construct($value = null)
{
@@ -97,8 +97,7 @@ class TSProperty
/**
* Set the name for the TSProperty.
*
- * @param string $name
- *
+ * @param string $name
* @return TSProperty
*/
public function setName($name)
@@ -121,8 +120,7 @@ class TSProperty
/**
* Set the value for the TSProperty.
*
- * @param string|int $value
- *
+ * @param string|int $value
* @return TSProperty
*/
public function setValue($value)
@@ -169,7 +167,7 @@ class TSProperty
/**
* Given a TSProperty blob, decode the name/value/type/etc.
*
- * @param string $tsProperty
+ * @param string $tsProperty
*/
protected function decode($tsProperty)
{
@@ -186,9 +184,8 @@ class TSProperty
/**
* Based on the property name/value in question, get its encoded form.
*
- * @param string $propName
- * @param string|int $propValue
- *
+ * @param string $propName
+ * @param string|int $propValue
* @return string
*/
protected function getEncodedValueForProp($propName, $propValue)
@@ -210,9 +207,8 @@ class TSProperty
/**
* Based on the property name in question, get its actual value from the binary blob value.
*
- * @param string $propName
- * @param string $propValue
- *
+ * @param string $propName
+ * @param string $propValue
* @return string|int
*/
protected function getDecodedValueForProp($propName, $propValue)
@@ -238,9 +234,8 @@ class TSProperty
* Decode the property by inspecting the nibbles of each blob, checking
* the control, and adding up the results into a final value.
*
- * @param string $hex
- * @param bool $string Whether or not this is simple string data.
- *
+ * @param string $hex
+ * @param bool $string Whether or not this is simple string data.
* @return string
*/
protected function decodePropValue($hex, $string = false)
@@ -272,9 +267,8 @@ class TSProperty
/**
* Get the encoded property value as a binary blob.
*
- * @param string $value
- * @param bool $string
- *
+ * @param string $value
+ * @param bool $string
* @return string
*/
protected function encodePropValue($value, $string = false)
@@ -314,9 +308,8 @@ class TSProperty
* a workaround that turns a literal bit-string into a
* packed byte-string with 8 bits per byte.
*
- * @param string $bits
- * @param bool $len
- *
+ * @param string $bits
+ * @param bool $len
* @return string
*/
protected function packBitString($bits, $len)
@@ -337,9 +330,8 @@ class TSProperty
/**
* Based on the control, adjust the nibble accordingly.
*
- * @param string $nibble
- * @param string $control
- *
+ * @param string $nibble
+ * @param string $control
* @return string
*/
protected function nibbleControl($nibble, $control)
@@ -362,9 +354,8 @@ class TSProperty
* the control for X or Y equals 011010. Additionally, if the dec value of the nibble is > 9, then the nibble value
* must be subtracted by 9 before the final value is constructed.
*
- * @param string $nibbleType Either X or Y
- * @param string $nibble
- *
+ * @param string $nibbleType Either X or Y
+ * @param string $nibble
* @return string
*/
protected function getNibbleWithControl($nibbleType, $nibble)
@@ -384,9 +375,8 @@ class TSProperty
/**
* Need to make sure hex values are always an even length, so pad as needed.
*
- * @param int $int
- * @param int $padLength The hex string must be padded to this length (with zeros).
- *
+ * @param int $int
+ * @param int $padLength The hex string must be padded to this length (with zeros).
* @return string
*/
protected function dec2hex($int, $padLength = 2)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSPropertyArray.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSPropertyArray.php
index 18316888..8320dd8e 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSPropertyArray.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/TSPropertyArray.php
@@ -9,14 +9,14 @@ class TSPropertyArray
/**
* Represents that the TSPropertyArray data is valid.
*/
- const VALID_SIGNATURE = 'P';
+ public const VALID_SIGNATURE = 'P';
/**
* The default values for the TSPropertyArray structure.
*
* @var array
*/
- const DEFAULTS = [
+ public const DEFAULTS = [
'CtxCfgPresent' => 2953518677,
'CtxWFProfilePath' => '',
'CtxWFProfilePathW' => '',
@@ -71,7 +71,7 @@ class TSPropertyArray
* - Pass the userParameters binary value. The object representation of that will be decoded and constructed.
* - Pass nothing and a default set of TSProperty key => value pairs will be used (See DEFAULTS constant).
*
- * @param mixed $tsPropertyArray
+ * @param mixed $tsPropertyArray
*/
public function __construct($tsPropertyArray = null)
{
@@ -93,8 +93,7 @@ class TSPropertyArray
/**
* Check if a specific TSProperty exists by its property name.
*
- * @param string $propName
- *
+ * @param string $propName
* @return bool
*/
public function has($propName)
@@ -105,8 +104,7 @@ class TSPropertyArray
/**
* Get a TSProperty object by its property name (ie. CtxWFProfilePath).
*
- * @param string $propName
- *
+ * @param string $propName
* @return TSProperty
*/
public function get($propName)
@@ -119,8 +117,7 @@ class TSPropertyArray
/**
* Add a TSProperty object. If it already exists, it will be overwritten.
*
- * @param TSProperty $tsProperty
- *
+ * @param TSProperty $tsProperty
* @return $this
*/
public function add(TSProperty $tsProperty)
@@ -133,8 +130,7 @@ class TSPropertyArray
/**
* Remove a TSProperty by its property name (ie. CtxMinEncryptionLevel).
*
- * @param string $propName
- *
+ * @param string $propName
* @return $this
*/
public function remove($propName)
@@ -151,9 +147,8 @@ class TSPropertyArray
/**
* Set the value for a specific TSProperty by its name.
*
- * @param string $propName
- * @param mixed $propValue
- *
+ * @param string $propName
+ * @param mixed $propValue
* @return $this
*/
public function set($propName, $propValue)
@@ -214,7 +209,7 @@ class TSPropertyArray
/**
* Validates that the given property name exists.
*
- * @param string $propName
+ * @param string $propName
*/
protected function validateProp($propName)
{
@@ -224,8 +219,7 @@ class TSPropertyArray
}
/**
- * @param string $propName
- *
+ * @param string $propName
* @return TSProperty
*/
protected function getTsPropObj($propName)
@@ -236,8 +230,7 @@ class TSPropertyArray
/**
* Get an associative array with all of the userParameters property names and values.
*
- * @param string $userParameters
- *
+ * @param string $userParameters
* @return void
*/
protected function decodeUserParameters($userParameters)
@@ -260,7 +253,7 @@ class TSPropertyArray
// Reserved data length + (count and sig length == 4) + the added lengths of the TSPropertyArray
// This saves anything after that variable TSPropertyArray data, so as to not squash anything stored there
if (strlen($userParameters) > (96 + 4 + $length)) {
- $this->postBinary = hex2bin(substr($userParameters, (96 + 4 + $length)));
+ $this->postBinary = hex2bin(substr($userParameters, 96 + 4 + $length));
}
}
@@ -270,9 +263,8 @@ class TSPropertyArray
* individual TSProperty structures. Return the full length
* of the TSPropertyArray data.
*
- * @param string $tsPropertyArray
- * @param int $tsPropCount
- *
+ * @param string $tsPropertyArray
+ * @param int $tsPropCount
* @return int The length of the data in the TSPropertyArray
*/
protected function addTSPropData($tsPropertyArray, $tsPropCount)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php
index e5d9dc34..0f07bc5a 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Attributes/Timestamp.php
@@ -5,11 +5,14 @@ namespace LdapRecord\Models\Attributes;
use Carbon\Carbon;
use Carbon\CarbonInterface;
use DateTime;
+use DateTimeZone;
use LdapRecord\LdapRecordException;
use LdapRecord\Utilities;
class Timestamp
{
+ public const WINDOWS_INT_MAX = 9223372036854775807;
+
/**
* The current timestamp type.
*
@@ -31,7 +34,7 @@ class Timestamp
/**
* Constructor.
*
- * @param string $type
+ * @param string $type
*
* @throws LdapRecordException
*/
@@ -43,7 +46,7 @@ class Timestamp
/**
* Set the type of timestamp to convert from / to.
*
- * @param string $type
+ * @param string $type
*
* @throws LdapRecordException
*/
@@ -59,8 +62,7 @@ class Timestamp
/**
* Converts the value to an LDAP date string.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return float|string
*
* @throws LdapRecordException
@@ -107,21 +109,19 @@ class Timestamp
/**
* Determine if the value given is in Windows Integer (NTFS Filetime) format.
*
- * @param int|string $value
- *
+ * @param int|string $value
* @return bool
*/
protected function valueIsWindowsIntegerType($value)
{
- return is_numeric($value) && strlen((string) $value) === 18;
+ return is_numeric($value) && in_array(strlen((string) $value), [18, 19]);
}
/**
* Converts the LDAP timestamp value to a Carbon instance.
*
- * @param mixed $value
- *
- * @return Carbon|false
+ * @param mixed $value
+ * @return Carbon|int|false
*
* @throws LdapRecordException
*/
@@ -153,14 +153,13 @@ class Timestamp
/**
* Converts standard LDAP timestamps to a date time object.
*
- * @param string $value
- *
+ * @param string $value
* @return DateTime|false
*/
protected function convertLdapTimeToDateTime($value)
{
return DateTime::createFromFormat(
- strpos($value, 'Z') !== false ? 'YmdHis\Z' : 'YmdHisT',
+ str_contains((string) $value, 'Z') ? 'YmdHis\Z' : 'YmdHisT',
$value
);
}
@@ -168,8 +167,7 @@ class Timestamp
/**
* Converts date objects to a standard LDAP timestamp.
*
- * @param DateTime $date
- *
+ * @param DateTime $date
* @return string
*/
protected function convertDateTimeToLdapTime(DateTime $date)
@@ -182,23 +180,22 @@ class Timestamp
/**
* Converts standard windows timestamps to a date time object.
*
- * @param string $value
- *
+ * @param string $value
* @return DateTime|false
*/
protected function convertWindowsTimeToDateTime($value)
{
return DateTime::createFromFormat(
- strpos($value, '0Z') !== false ? 'YmdHis.0\Z' : 'YmdHis.0T',
- $value
+ str_contains((string) $value, '0Z') ? 'YmdHis.0\Z' : 'YmdHis.0T',
+ $value,
+ new DateTimeZone('UTC')
);
}
/**
* Converts date objects to a windows timestamp.
*
- * @param DateTime $date
- *
+ * @param DateTime $date
* @return string
*/
protected function convertDateTimeToWindows(DateTime $date)
@@ -211,20 +208,25 @@ class Timestamp
/**
* Converts standard windows integer dates to a date time object.
*
- * @param int $value
- *
- * @return DateTime|false
+ * @param int $value
+ * @return DateTime|int|false
*
* @throws \Exception
*/
protected function convertWindowsIntegerTimeToDateTime($value)
{
- // ActiveDirectory dates that contain integers may return
- // "0" when they are not set. We will validate that here.
- if (! $value) {
+ if (is_null($value) || $value === '') {
return false;
}
+ if ($value == 0) {
+ return (int) $value;
+ }
+
+ if ($value == static::WINDOWS_INT_MAX) {
+ return (int) $value;
+ }
+
return (new DateTime())->setTimestamp(
Utilities::convertWindowsTimeToUnixTime($value)
);
@@ -233,8 +235,7 @@ class Timestamp
/**
* Converts date objects to a windows integer timestamp.
*
- * @param DateTime $date
- *
+ * @param DateTime $date
* @return float
*/
protected function convertDateTimeToWindowsInteger(DateTime $date)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/BatchModification.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/BatchModification.php
index 37f0e876..954c58fc 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/BatchModification.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/BatchModification.php
@@ -11,9 +11,9 @@ class BatchModification
/**
* The array keys to be used in batch modifications.
*/
- const KEY_ATTRIB = 'attrib';
- const KEY_MODTYPE = 'modtype';
- const KEY_VALUES = 'values';
+ public const KEY_ATTRIB = 'attrib';
+ public const KEY_MODTYPE = 'modtype';
+ public const KEY_VALUES = 'values';
/**
* The attribute of the modification.
@@ -46,9 +46,9 @@ class BatchModification
/**
* Constructor.
*
- * @param string|null $attribute
- * @param string|int|null $type
- * @param array $values
+ * @param string|null $attribute
+ * @param string|int|null $type
+ * @param array $values
*/
public function __construct($attribute = null, $type = null, array $values = [])
{
@@ -60,8 +60,7 @@ class BatchModification
/**
* Set the original value of the attribute before modification.
*
- * @param array|string $original
- *
+ * @param array|string $original
* @return $this
*/
public function setOriginal($original = [])
@@ -84,8 +83,7 @@ class BatchModification
/**
* Set the attribute of the modification.
*
- * @param string $attribute
- *
+ * @param string $attribute
* @return $this
*/
public function setAttribute($attribute)
@@ -108,8 +106,7 @@ class BatchModification
/**
* Set the values of the modification.
*
- * @param array $values
- *
+ * @param array $values
* @return $this
*/
public function setValues(array $values = [])
@@ -127,8 +124,7 @@ class BatchModification
/**
* Normalize all of the attribute values.
*
- * @param array|string $values
- *
+ * @param array|string $values
* @return array
*/
protected function normalizeAttributeValues($values = [])
@@ -152,8 +148,7 @@ class BatchModification
/**
* Set the type of the modification.
*
- * @param int|null $type
- *
+ * @param int|null $type
* @return $this
*/
public function setType($type = null)
@@ -207,7 +202,7 @@ class BatchModification
case empty($this->original) && ! empty($this->values):
return $this->setType(LDAP_MODIFY_BATCH_ADD);
default:
- return $this->determineBatchTypeFromOriginal();
+ return $this->determineBatchTypeFromOriginal();
}
}
@@ -291,8 +286,7 @@ class BatchModification
/**
* Determines if the given modtype is valid.
*
- * @param int $type
- *
+ * @param int $type
* @return bool
*/
protected function isValidType($type)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Collection.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Collection.php
index 850167b7..11b4ca52 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Collection.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Collection.php
@@ -10,10 +10,21 @@ use LdapRecord\Support\Arr;
class Collection extends QueryCollection
{
/**
- * Determine if the collection contains all of the given models, or any models.
+ * Get a collection of the model's distinguished names.
*
- * @param mixed $models
+ * @return static
+ */
+ public function modelDns()
+ {
+ return $this->map(function (Model $model) {
+ return $model->getDn();
+ });
+ }
+
+ /**
+ * Determine if the collection contains all of the given models, or any models.
*
+ * @param mixed $models
* @return bool
*/
public function exists($models = null)
@@ -47,10 +58,9 @@ class Collection extends QueryCollection
/**
* Determine if any of the given models are contained in the collection.
*
- * @param mixed $key
- * @param mixed $operator
- * @param mixed $value
- *
+ * @param mixed $key
+ * @param mixed $operator
+ * @param mixed $value
* @return bool
*/
public function contains($key, $operator = null, $value = null)
@@ -78,8 +88,7 @@ class Collection extends QueryCollection
/**
* Get the provided models as an array.
*
- * @param mixed $models
- *
+ * @param mixed $models
* @return array
*/
protected function getArrayableModels($models = null)
@@ -92,17 +101,16 @@ class Collection extends QueryCollection
/**
* Compare the related model with the given.
*
- * @param Model|string $model
- * @param Model $related
- *
+ * @param Model|string $model
+ * @param Model $related
* @return bool
*/
protected function compareModelWithRelated($model, $related)
{
if (is_string($model)) {
return $this->isValidDn($model)
- ? $related->getDn() == $model
- : $related->getName() == $model;
+ ? strcasecmp($related->getDn(), $model) === 0
+ : strcasecmp($related->getName(), $model) === 0;
}
return $related->is($model);
@@ -111,8 +119,7 @@ class Collection extends QueryCollection
/**
* Determine if the given string is a valid distinguished name.
*
- * @param string $dn
- *
+ * @param string $dn
* @return bool
*/
protected function isValidDn($dn)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php
index 451738ab..6e8d4fb5 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/CanAuthenticate.php
@@ -2,6 +2,7 @@
namespace LdapRecord\Models\Concerns;
+/** @mixin \LdapRecord\Models\Model */
trait CanAuthenticate
{
/**
@@ -17,7 +18,7 @@ trait CanAuthenticate
/**
* Get the unique identifier for the user.
*
- * @return mixed
+ * @return string
*/
public function getAuthIdentifier()
{
@@ -47,8 +48,7 @@ trait CanAuthenticate
/**
* Set the token value for the "remember me" session.
*
- * @param string $value
- *
+ * @param string $value
* @return void
*/
public function setRememberToken($value)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php
index b5f33357..a3d9df7d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasAttributes.php
@@ -74,6 +74,18 @@ trait HasAttributes
*/
protected static $mutatorCache = [];
+ /**
+ * Convert the model's original attributes to an array.
+ *
+ * @return array
+ */
+ public function originalToArray()
+ {
+ return $this->encodeAttributes(
+ $this->convertAttributesForJson($this->original)
+ );
+ }
+
/**
* Convert the model's attributes to an array.
*
@@ -112,10 +124,37 @@ trait HasAttributes
}
/**
- * Add the date attributes to the attributes array.
+ * Convert the model's serialized original attributes to their original form.
+ *
+ * @param array $attributes
+ * @return array
+ */
+ public function arrayToOriginal(array $attributes)
+ {
+ return $this->decodeAttributes(
+ $this->convertAttributesFromJson($attributes)
+ );
+ }
+
+ /**
+ * Convert the model's serialized attributes to their original form.
*
- * @param array $attributes
+ * @param array $attributes
+ * @return array
+ */
+ public function arrayToAttributes(array $attributes)
+ {
+ $attributes = $this->restoreDateAttributesFromArray($attributes);
+
+ return $this->decodeAttributes(
+ $this->convertAttributesFromJson($attributes)
+ );
+ }
+
+ /**
+ * Add the date attributes to the attributes array.
*
+ * @param array $attributes
* @return array
*/
protected function addDateAttributesToArray(array $attributes)
@@ -136,10 +175,30 @@ trait HasAttributes
}
/**
- * Prepare a date for array / JSON serialization.
+ * Restore the date attributes to their true value from serialized attributes.
*
- * @param DateTimeInterface $date
+ * @param array $attributes
+ * @return array
+ */
+ protected function restoreDateAttributesFromArray(array $attributes)
+ {
+ foreach ($this->getDates() as $attribute => $type) {
+ if (! isset($attributes[$attribute])) {
+ continue;
+ }
+
+ $date = $this->fromDateTime($type, $attributes[$attribute]);
+
+ $attributes[$attribute] = Arr::wrap($date);
+ }
+
+ return $attributes;
+ }
+
+ /**
+ * Prepare a date for array / JSON serialization.
*
+ * @param DateTimeInterface $date
* @return string
*/
protected function serializeDate(DateTimeInterface $date)
@@ -162,10 +221,24 @@ trait HasAttributes
}
/**
- * Encode the given value for proper serialization.
+ * Recursively UTF-8 decode the given attributes.
*
- * @param string $value
+ * @param array $attributes
+ * @return array
+ */
+ public function decodeAttributes($attributes)
+ {
+ array_walk_recursive($attributes, function (&$value) {
+ $value = $this->decodeValue($value);
+ });
+
+ return $attributes;
+ }
+
+ /**
+ * Encode the value for serialization.
*
+ * @param string $value
* @return string
*/
protected function encodeValue($value)
@@ -173,15 +246,33 @@ trait HasAttributes
// If we are able to detect the encoding, we will
// encode only the attributes that need to be,
// so that we do not double encode values.
- return MbString::isLoaded() && MbString::isUtf8($value) ? $value : utf8_encode($value);
+ if (MbString::isLoaded() && MbString::isUtf8($value)) {
+ return $value;
+ }
+
+ return utf8_encode($value);
}
/**
- * Add the mutated attributes to the attributes array.
+ * Decode the value from serialization.
*
- * @param array $attributes
- * @param array $mutatedAttributes
+ * @param string $value
+ * @return string
+ */
+ protected function decodeValue($value)
+ {
+ if (MbString::isLoaded() && MbString::isUtf8($value)) {
+ return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
+ }
+
+ return $value;
+ }
+
+ /**
+ * Add the mutated attributes to the attributes array.
*
+ * @param array $attributes
+ * @param array $mutatedAttributes
* @return array
*/
protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes)
@@ -221,8 +312,7 @@ trait HasAttributes
/**
* Fills the entry with the supplied attributes.
*
- * @param array $attributes
- *
+ * @param array $attributes
* @return $this
*/
public function fill(array $attributes = [])
@@ -237,9 +327,8 @@ trait HasAttributes
/**
* Returns the models attribute by its key.
*
- * @param int|string $key
- * @param mixed $default
- *
+ * @param int|string $key
+ * @param mixed $default
* @return mixed
*/
public function getAttribute($key, $default = null)
@@ -254,9 +343,8 @@ trait HasAttributes
/**
* Get an attributes value.
*
- * @param string $key
- * @param mixed $default
- *
+ * @param string $key
+ * @param mixed $default
* @return mixed
*/
public function getAttributeValue($key, $default = null)
@@ -282,8 +370,7 @@ trait HasAttributes
/**
* Determine if the given attribute is a date.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function isDateAttribute($key)
@@ -310,9 +397,8 @@ trait HasAttributes
/**
* Convert the given date value to an LDAP compatible value.
*
- * @param string $type
- * @param mixed $value
- *
+ * @param string $type
+ * @param mixed $value
* @return float|string
*
* @throws LdapRecordException
@@ -325,9 +411,8 @@ trait HasAttributes
/**
* Convert the given LDAP date value to a Carbon instance.
*
- * @param mixed $value
- * @param string $type
- *
+ * @param mixed $value
+ * @param string $type
* @return Carbon|false
*
* @throws LdapRecordException
@@ -340,9 +425,8 @@ trait HasAttributes
/**
* Determine whether an attribute should be cast to a native type.
*
- * @param string $key
- * @param array|string|null $types
- *
+ * @param string $key
+ * @param array|string|null $types
* @return bool
*/
public function hasCast($key, $types = null)
@@ -367,8 +451,7 @@ trait HasAttributes
/**
* Determine whether a value is JSON castable for inbound manipulation.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
protected function isJsonCastable($key)
@@ -379,8 +462,7 @@ trait HasAttributes
/**
* Get the type of cast for a model attribute.
*
- * @param string $key
- *
+ * @param string $key
* @return string
*/
protected function getCastType($key)
@@ -399,8 +481,7 @@ trait HasAttributes
/**
* Determine if the cast is a decimal.
*
- * @param string $cast
- *
+ * @param string $cast
* @return bool
*/
protected function isDecimalCast($cast)
@@ -411,8 +492,7 @@ trait HasAttributes
/**
* Determine if the cast is a datetime.
*
- * @param string $cast
- *
+ * @param string $cast
* @return bool
*/
protected function isDateTimeCast($cast)
@@ -423,8 +503,7 @@ trait HasAttributes
/**
* Determine if the given attribute must be casted.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
protected function isCastedAttribute($key)
@@ -435,9 +514,8 @@ trait HasAttributes
/**
* Cast an attribute to a native PHP type.
*
- * @param string $key
- * @param array|null $value
- *
+ * @param string $key
+ * @param array|null $value
* @return mixed
*/
protected function castAttribute($key, $value)
@@ -490,9 +568,8 @@ trait HasAttributes
/**
* Cast the given attribute to JSON.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return string
*/
protected function castAttributeAsJson($key, $value)
@@ -522,8 +599,7 @@ trait HasAttributes
/**
* Encode the given value as JSON.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return string
*/
protected function asJson($value)
@@ -534,9 +610,8 @@ trait HasAttributes
/**
* Decode the given JSON back into an array or object.
*
- * @param string $value
- * @param bool $asObject
- *
+ * @param string $value
+ * @param bool $asObject
* @return mixed
*/
public function fromJson($value, $asObject = false)
@@ -547,8 +622,7 @@ trait HasAttributes
/**
* Decode the given float.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return mixed
*/
public function fromFloat($value)
@@ -568,8 +642,7 @@ trait HasAttributes
/**
* Cast the value to a boolean.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return bool
*/
protected function asBoolean($value)
@@ -582,9 +655,8 @@ trait HasAttributes
/**
* Cast a decimal value as a string.
*
- * @param float $value
- * @param int $decimals
- *
+ * @param float $value
+ * @param int $decimals
* @return string
*/
protected function asDecimal($value, $decimals)
@@ -605,8 +677,7 @@ trait HasAttributes
/**
* Get an attribute array of all arrayable values.
*
- * @param array $values
- *
+ * @param array $values
* @return array
*/
protected function getArrayableItems(array $values)
@@ -651,8 +722,7 @@ trait HasAttributes
/**
* Set the date format used by the model for serialization.
*
- * @param string $format
- *
+ * @param string $format
* @return $this
*/
public function setDateFormat($format)
@@ -665,8 +735,7 @@ trait HasAttributes
/**
* Get an attribute from the $attributes array.
*
- * @param string $key
- *
+ * @param string $key
* @return mixed
*/
protected function getAttributeFromArray($key)
@@ -687,9 +756,8 @@ trait HasAttributes
/**
* Returns the first attribute by the specified key.
*
- * @param string $key
- * @param mixed $default
- *
+ * @param string $key
+ * @param mixed $default
* @return mixed
*/
public function getFirstAttribute($key, $default = null)
@@ -712,9 +780,8 @@ trait HasAttributes
/**
* Set an attribute value by the specified key.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return $this
*/
public function setAttribute($key, $value)
@@ -743,9 +810,8 @@ trait HasAttributes
/**
* Set an attribute on the model. No checking is done.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return $this
*/
public function setRawAttribute($key, $value)
@@ -760,9 +826,8 @@ trait HasAttributes
/**
* Set the models first attribute value.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return $this
*/
public function setFirstAttribute($key, $value)
@@ -773,9 +838,8 @@ trait HasAttributes
/**
* Add a unique value to the given attribute.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return $this
*/
public function addAttributeValue($key, $value)
@@ -791,8 +855,7 @@ trait HasAttributes
/**
* Determine if a get mutator exists for an attribute.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function hasGetMutator($key)
@@ -803,8 +866,7 @@ trait HasAttributes
/**
* Determine if a set mutator exists for an attribute.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function hasSetMutator($key)
@@ -815,9 +877,8 @@ trait HasAttributes
/**
* Set the value of an attribute using its mutator.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return mixed
*/
protected function setMutatedAttributeValue($key, $value)
@@ -828,9 +889,8 @@ trait HasAttributes
/**
* Get the value of an attribute using its mutator.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return mixed
*/
protected function getMutatedAttributeValue($key, $value)
@@ -843,8 +903,7 @@ trait HasAttributes
*
* Hyphenated attributes will use pascal cased methods.
*
- * @param string $key
- *
+ * @param string $key
* @return mixed
*/
protected function getMutatorMethodName($key)
@@ -857,9 +916,8 @@ trait HasAttributes
/**
* Get the value of an attribute using its mutator for array conversion.
*
- * @param string $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return array
*/
protected function mutateAttributeForArray($key, $value)
@@ -874,8 +932,7 @@ trait HasAttributes
*
* Used when constructing an existing LDAP record.
*
- * @param array $attributes
- *
+ * @param array $attributes
* @return $this
*/
public function setRawAttributes(array $attributes = [])
@@ -915,9 +972,8 @@ trait HasAttributes
/**
* Filters the count key recursively from raw LDAP attributes.
*
- * @param array $attributes
- * @param array $keys
- *
+ * @param array $attributes
+ * @param array $keys
* @return array
*/
public function filterRawAttributes(array $attributes = [], array $keys = ['count', 'dn'])
@@ -938,8 +994,7 @@ trait HasAttributes
/**
* Determine if the model has the given attribute.
*
- * @param int|string $key
- *
+ * @param int|string $key
* @return bool
*/
public function hasAttribute($key)
@@ -991,8 +1046,7 @@ trait HasAttributes
/**
* Determine if the given attribute is dirty.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function isDirty($key)
@@ -1013,8 +1067,7 @@ trait HasAttributes
/**
* Set the accessors to append to model arrays.
*
- * @param array $appends
- *
+ * @param array $appends
* @return $this
*/
public function setAppends(array $appends)
@@ -1027,8 +1080,7 @@ trait HasAttributes
/**
* Return whether the accessor attribute has been appended.
*
- * @param string $attribute
- *
+ * @param string $attribute
* @return bool
*/
public function hasAppended($attribute)
@@ -1039,8 +1091,7 @@ trait HasAttributes
/**
* Returns a normalized attribute key.
*
- * @param string $key
- *
+ * @param string $key
* @return string
*/
public function normalizeAttributeKey($key)
@@ -1056,8 +1107,7 @@ trait HasAttributes
/**
* Determine if the new and old values for a given key are equivalent.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
protected function originalIsEquivalent($key)
@@ -1097,8 +1147,7 @@ trait HasAttributes
/**
* Extract and cache all the mutated attributes of a class.
*
- * @param string $class
- *
+ * @param string $class
* @return void
*/
public static function cacheMutatedAttributes($class)
@@ -1113,8 +1162,7 @@ trait HasAttributes
/**
* Get all of the attribute mutator methods.
*
- * @param mixed $class
- *
+ * @param mixed $class
* @return array
*/
protected static function getMutatorMethods($class)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php
index 5adec96e..d9a41b89 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasEvents.php
@@ -4,15 +4,17 @@ namespace LdapRecord\Models\Concerns;
use Closure;
use LdapRecord\Events\NullDispatcher;
+use LdapRecord\Models\Events;
use LdapRecord\Models\Events\Event;
+use LdapRecord\Support\Arr;
+/** @mixin \LdapRecord\Models\Model */
trait HasEvents
{
/**
* Execute the callback without raising any events.
*
- * @param Closure $callback
- *
+ * @param Closure $callback
* @return mixed
*/
protected static function withoutEvents(Closure $callback)
@@ -37,10 +39,37 @@ trait HasEvents
}
/**
- * Fires the specified model event.
+ * Dispatch the given model events.
+ *
+ * @param string|array $events
+ * @param array $args
+ * @return void
+ */
+ protected function dispatch($events, array $args = [])
+ {
+ foreach (Arr::wrap($events) as $name) {
+ $this->fireCustomModelEvent($name, $args);
+ }
+ }
+
+ /**
+ * Fire a custom model event.
*
- * @param Event $event
+ * @param string $name
+ * @param array $args
+ * @return mixed
+ */
+ protected function fireCustomModelEvent($name, array $args = [])
+ {
+ $event = implode('\\', [Events::class, ucfirst($name)]);
+
+ return $this->fireModelEvent(new $event($this, ...$args));
+ }
+
+ /**
+ * Fire a model event.
*
+ * @param Event $event
* @return mixed
*/
protected function fireModelEvent(Event $event)
@@ -49,11 +78,10 @@ trait HasEvents
}
/**
- * Listens to a model event.
- *
- * @param string $event
- * @param Closure $listener
+ * Listen to a model event.
*
+ * @param string $event
+ * @param Closure $listener
* @return mixed
*/
protected function listenForModelEvent($event, Closure $listener)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php
index f7552c1b..4d0f2968 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasGlobalScopes.php
@@ -6,14 +6,14 @@ use Closure;
use InvalidArgumentException;
use LdapRecord\Models\Scope;
+/** @mixin \LdapRecord\Models\Model */
trait HasGlobalScopes
{
/**
* Register a new global scope on the model.
*
- * @param Scope|Closure|string $scope
- * @param Closure|null $implementation
- *
+ * @param Scope|Closure|string $scope
+ * @param Closure|null $implementation
* @return mixed
*
* @throws InvalidArgumentException
@@ -34,8 +34,7 @@ trait HasGlobalScopes
/**
* Determine if a model has a global scope.
*
- * @param Scope|string $scope
- *
+ * @param Scope|string $scope
* @return bool
*/
public static function hasGlobalScope($scope)
@@ -46,8 +45,7 @@ trait HasGlobalScopes
/**
* Get a global scope registered with the model.
*
- * @param Scope|string $scope
- *
+ * @param Scope|string $scope
* @return Scope|Closure|null
*/
public static function getGlobalScope($scope)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php
index 1a938c14..194efa8c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasPassword.php
@@ -6,12 +6,13 @@ use LdapRecord\ConnectionException;
use LdapRecord\LdapRecordException;
use LdapRecord\Models\Attributes\Password;
+/** @mixin \LdapRecord\Models\Model */
trait HasPassword
{
/**
* Set the password on the user.
*
- * @param string|array $password
+ * @param string|array $password
*
* @throws ConnectionException
*/
@@ -48,7 +49,7 @@ trait HasPassword
/**
* Alias for setting the password on the user.
*
- * @param string|array $password
+ * @param string|array $password
*
* @throws ConnectionException
*/
@@ -106,10 +107,9 @@ trait HasPassword
/**
* Set the changed password.
*
- * @param string $oldPassword
- * @param string $newPassword
- * @param string $attribute
- *
+ * @param string $oldPassword
+ * @param string $newPassword
+ * @param string $attribute
* @return void
*/
protected function setChangedPassword($oldPassword, $newPassword, $attribute)
@@ -136,9 +136,8 @@ trait HasPassword
/**
* Set the password on the model.
*
- * @param string $password
- * @param string $attribute
- *
+ * @param string $password
+ * @param string $attribute
* @return void
*/
protected function setPassword($password, $attribute)
@@ -155,10 +154,9 @@ trait HasPassword
/**
* Encode / hash the given password.
*
- * @param string $method
- * @param string $password
- * @param string $salt
- *
+ * @param string $method
+ * @param string $password
+ * @param string $salt
* @return string
*
* @throws LdapRecordException
@@ -203,8 +201,7 @@ trait HasPassword
/**
* Attempt to retrieve the password's salt.
*
- * @param string $method
- *
+ * @param string $method
* @return string|null
*/
public function getPasswordSalt($method)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasRelationships.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasRelationships.php
index a8a5cacf..87c0a7cc 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasRelationships.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasRelationships.php
@@ -5,6 +5,7 @@ namespace LdapRecord\Models\Concerns;
use LdapRecord\Models\Relations\HasMany;
use LdapRecord\Models\Relations\HasManyIn;
use LdapRecord\Models\Relations\HasOne;
+use LdapRecord\Models\Relations\Relation;
use LdapRecord\Support\Arr;
trait HasRelationships
@@ -12,10 +13,9 @@ trait HasRelationships
/**
* Returns a new has one relationship.
*
- * @param mixed $related
- * @param string $relationKey
- * @param string $foreignKey
- *
+ * @param mixed $related
+ * @param string $relationKey
+ * @param string $foreignKey
* @return HasOne
*/
public function hasOne($related, $relationKey, $foreignKey = 'dn')
@@ -26,10 +26,9 @@ trait HasRelationships
/**
* Returns a new has many relationship.
*
- * @param mixed $related
- * @param string $relationKey
- * @param string $foreignKey
- *
+ * @param mixed $related
+ * @param string $relationKey
+ * @param string $foreignKey
* @return HasMany
*/
public function hasMany($related, $relationKey, $foreignKey = 'dn')
@@ -40,10 +39,9 @@ trait HasRelationships
/**
* Returns a new has many in relationship.
*
- * @param mixed $related
- * @param string $relationKey
- * @param string $foreignKey
- *
+ * @param mixed $related
+ * @param string $relationKey
+ * @param string $foreignKey
* @return HasManyIn
*/
public function hasManyIn($related, $relationKey, $foreignKey = 'dn')
@@ -51,6 +49,29 @@ trait HasRelationships
return new HasManyIn($this->newQuery(), $this, $related, $relationKey, $foreignKey, $this->guessRelationshipName());
}
+ /**
+ * Get a relationship by its name.
+ *
+ * @param string $relationName
+ * @return Relation|null
+ */
+ public function getRelation($relationName)
+ {
+ if (! method_exists($this, $relationName)) {
+ return;
+ }
+
+ if (! $relation = $this->{$relationName}()) {
+ return;
+ }
+
+ if (! $relation instanceof Relation) {
+ return;
+ }
+
+ return $relation;
+ }
+
/**
* Get the relationships name.
*
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasScopes.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasScopes.php
index 6c97cf92..cb227fec 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasScopes.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HasScopes.php
@@ -2,6 +2,7 @@
namespace LdapRecord\Models\Concerns;
+/** @mixin \LdapRecord\Models\Model */
trait HasScopes
{
/**
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HidesAttributes.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HidesAttributes.php
index 9cc21005..ecd328da 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HidesAttributes.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/HidesAttributes.php
@@ -6,6 +6,8 @@ namespace LdapRecord\Models\Concerns;
* @author Taylor Otwell
*
* @see https://laravel.com
+ *
+ * @mixin \LdapRecord\Models\Model
*/
trait HidesAttributes
{
@@ -38,8 +40,7 @@ trait HidesAttributes
/**
* Set the hidden attributes for the model.
*
- * @param array $hidden
- *
+ * @param array $hidden
* @return $this
*/
public function setHidden(array $hidden)
@@ -52,8 +53,7 @@ trait HidesAttributes
/**
* Add hidden attributes for the model.
*
- * @param array|string|null $attributes
- *
+ * @param array|string|null $attributes
* @return void
*/
public function addHidden($attributes = null)
@@ -79,8 +79,7 @@ trait HidesAttributes
/**
* Set the visible attributes for the model.
*
- * @param array $visible
- *
+ * @param array $visible
* @return $this
*/
public function setVisible(array $visible)
@@ -93,8 +92,7 @@ trait HidesAttributes
/**
* Add visible attributes for the model.
*
- * @param array|string|null $attributes
- *
+ * @param array|string|null $attributes
* @return void
*/
public function addVisible($attributes = null)
@@ -108,8 +106,7 @@ trait HidesAttributes
/**
* Make the given, typically hidden, attributes visible.
*
- * @param array|string $attributes
- *
+ * @param array|string $attributes
* @return $this
*/
public function makeVisible($attributes)
@@ -126,8 +123,7 @@ trait HidesAttributes
/**
* Make the given, typically visible, attributes hidden.
*
- * @param array|string $attributes
- *
+ * @param array|string $attributes
* @return $this
*/
public function makeHidden($attributes)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesAndRestoresPropertyValues.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesAndRestoresPropertyValues.php
new file mode 100644
index 00000000..cf550c74
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesAndRestoresPropertyValues.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace LdapRecord\Models\Concerns;
+
+/** @mixin HasAttributes */
+trait SerializesAndRestoresPropertyValues
+{
+ /**
+ * Get the property value prepared for serialization.
+ *
+ * @param string $property
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function getSerializedPropertyValue($property, $value)
+ {
+ if ($property === 'original') {
+ return $this->originalToArray();
+ }
+
+ if ($property === 'attributes') {
+ return $this->attributesToArray();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Get the unserialized property value after deserialization.
+ *
+ * @param string $property
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function getUnserializedPropertyValue($property, $value)
+ {
+ if ($property === 'original') {
+ return $this->arrayToOriginal($value);
+ }
+
+ if ($property === 'attributes') {
+ return $this->arrayToAttributes($value);
+ }
+
+ return $value;
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesProperties.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesProperties.php
new file mode 100644
index 00000000..91f4bcfe
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Concerns/SerializesProperties.php
@@ -0,0 +1,143 @@
+<?php
+
+namespace LdapRecord\Models\Concerns;
+
+use ReflectionClass;
+use ReflectionProperty;
+
+trait SerializesProperties
+{
+ use SerializesAndRestoresPropertyValues;
+
+ /**
+ * Prepare the attributes for serialization.
+ *
+ * @return array
+ */
+ public function __sleep()
+ {
+ $properties = (new ReflectionClass($this))->getProperties();
+
+ foreach ($properties as $property) {
+ $property->setValue($this, $this->getSerializedPropertyValue(
+ $property->getName(),
+ $this->getPropertyValue($property)
+ ));
+ }
+
+ return array_values(array_filter(array_map(function ($p) {
+ return $p->isStatic() ? null : $p->getName();
+ }, $properties)));
+ }
+
+ /**
+ * Restore the attributes after serialization.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ foreach ((new ReflectionClass($this))->getProperties() as $property) {
+ if ($property->isStatic()) {
+ continue;
+ }
+
+ $property->setValue($this, $this->getUnserializedPropertyValue(
+ $property->getName(),
+ $this->getPropertyValue($property)
+ ));
+ }
+ }
+
+ /**
+ * Prepare the model for serialization.
+ *
+ * @return array
+ */
+ public function __serialize()
+ {
+ $values = [];
+
+ $properties = (new ReflectionClass($this))->getProperties();
+
+ $class = get_class($this);
+
+ foreach ($properties as $property) {
+ if ($property->isStatic()) {
+ continue;
+ }
+
+ $property->setAccessible(true);
+
+ if (! $property->isInitialized($this)) {
+ continue;
+ }
+
+ $name = $property->getName();
+
+ if ($property->isPrivate()) {
+ $name = "\0{$class}\0{$name}";
+ } elseif ($property->isProtected()) {
+ $name = "\0*\0{$name}";
+ }
+
+ $values[$name] = $this->getSerializedPropertyValue(
+ $property->getName(),
+ $this->getPropertyValue($property)
+ );
+ }
+
+ return $values;
+ }
+
+ /**
+ * Restore the model after serialization.
+ *
+ * @param array $values
+ * @return void
+ */
+ public function __unserialize(array $values)
+ {
+ $properties = (new ReflectionClass($this))->getProperties();
+
+ $class = get_class($this);
+
+ foreach ($properties as $property) {
+ if ($property->isStatic()) {
+ continue;
+ }
+
+ $name = $property->getName();
+
+ if ($property->isPrivate()) {
+ $name = "\0{$class}\0{$name}";
+ } elseif ($property->isProtected()) {
+ $name = "\0*\0{$name}";
+ }
+
+ if (! array_key_exists($name, $values)) {
+ continue;
+ }
+
+ $property->setAccessible(true);
+
+ $property->setValue(
+ $this,
+ $this->getUnserializedPropertyValue($property->getName(), $values[$name])
+ );
+ }
+ }
+
+ /**
+ * Get the property value for the given property.
+ *
+ * @param ReflectionProperty $property
+ * @return mixed
+ */
+ protected function getPropertyValue(ReflectionProperty $property)
+ {
+ $property->setAccessible(true);
+
+ return $property->getValue($this);
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DetectsResetIntegers.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DetectsResetIntegers.php
index 8712ef75..7b8d1830 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DetectsResetIntegers.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DetectsResetIntegers.php
@@ -11,8 +11,7 @@ trait DetectsResetIntegers
* LDAP attributes to instruct the server to reset the
* value to an 'unset' or 'cleared' state.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return bool
*/
protected function valueIsResetInteger($value)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DirectoryServer/Entry.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DirectoryServer/Entry.php
index 1bf83258..a67200e9 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DirectoryServer/Entry.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/DirectoryServer/Entry.php
@@ -3,8 +3,9 @@
namespace LdapRecord\Models\DirectoryServer;
use LdapRecord\Models\Model;
+use LdapRecord\Models\Types\DirectoryServer;
-class Entry extends Model
+class Entry extends Model implements DirectoryServer
{
/**
* The attribute key that contains the models object GUID.
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Event.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Event.php
index 20de0b7a..8dbd1d29 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Event.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Event.php
@@ -16,7 +16,7 @@ abstract class Event
/**
* Constructor.
*
- * @param Model $model
+ * @param Model $model
*/
public function __construct(Model $model)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Renaming.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Renaming.php
index 83427ca1..5e7be97d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Renaming.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Events/Renaming.php
@@ -23,9 +23,9 @@ class Renaming extends Event
/**
* Constructor.
*
- * @param Model $model
- * @param string $rdn
- * @param string $newParentDn
+ * @param Model $model
+ * @param string $rdn
+ * @param string $newParentDn
*/
public function __construct(Model $model, $rdn, $newParentDn)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Entry.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Entry.php
index 7fdda9c8..be6322b1 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Entry.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Entry.php
@@ -44,8 +44,7 @@ class Entry extends BaseEntry implements FreeIPA
/**
* Create a new query builder.
*
- * @param Connection $connection
- *
+ * @param Connection $connection
* @return FreeIpaBuilder
*/
public function newQueryBuilder(Connection $connection)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Scopes/AddEntryUuidToSelects.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Scopes/AddEntryUuidToSelects.php
index 039c05e4..581b5bee 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Scopes/AddEntryUuidToSelects.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/FreeIPA/Scopes/AddEntryUuidToSelects.php
@@ -11,9 +11,8 @@ class AddEntryUuidToSelects implements Scope
/**
* Add the entry UUID to the selected attributes.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php
index 2e11696b..932c1a3b 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Model.php
@@ -11,8 +11,6 @@ use LdapRecord\Container;
use LdapRecord\EscapesValues;
use LdapRecord\Models\Attributes\DistinguishedName;
use LdapRecord\Models\Attributes\Guid;
-use LdapRecord\Models\Events\Renamed;
-use LdapRecord\Models\Events\Renaming;
use LdapRecord\Query\Model\Builder;
use LdapRecord\Support\Arr;
use UnexpectedValueException;
@@ -27,6 +25,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
use Concerns\HasGlobalScopes;
use Concerns\HidesAttributes;
use Concerns\HasRelationships;
+ use Concerns\SerializesProperties;
/**
* Indicates if the model exists in the directory.
@@ -115,7 +114,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Constructor.
*
- * @param array $attributes
+ * @param array $attributes
*/
public function __construct(array $attributes = [])
{
@@ -163,9 +162,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Handle dynamic method calls into the model.
*
- * @param string $method
- * @param array $parameters
- *
+ * @param string $method
+ * @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
@@ -180,9 +178,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Handle dynamic static method calls into the method.
*
- * @param string $method
- * @param array $parameters
- *
+ * @param string $method
+ * @param array $parameters
* @return mixed
*/
public static function __callStatic($method, $parameters)
@@ -203,8 +200,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Set the models distinguished name.
*
- * @param string $dn
- *
+ * @param string $dn
* @return $this
*/
public function setDn($dn)
@@ -217,8 +213,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* A mutator for setting the models distinguished name.
*
- * @param string $dn
- *
+ * @param string $dn
* @return $this
*/
public function setDnAttribute($dn)
@@ -229,8 +224,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* A mutator for setting the models distinguished name.
*
- * @param string $dn
- *
+ * @param string $dn
* @return $this
*/
public function setDistinguishedNameAttribute($dn)
@@ -261,8 +255,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Set the connection associated with the model.
*
- * @param string $name
- *
+ * @param string $name
* @return $this
*/
public function setConnection($name)
@@ -273,10 +266,20 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
}
/**
- * Begin querying the model on a given connection.
+ * Make a new model instance.
*
- * @param string|null $connection
+ * @param array $attributes
+ * @return static
+ */
+ public static function make($attributes = [])
+ {
+ return new static($attributes);
+ }
+
+ /**
+ * Begin querying the model on a given connection.
*
+ * @param string|null $connection
* @return Builder
*/
public static function on($connection = null)
@@ -291,8 +294,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get all the models from the directory.
*
- * @param array|mixed $attributes
- *
+ * @param array|mixed $attributes
* @return Collection|static[]
*/
public static function all($attributes = ['*'])
@@ -301,15 +303,45 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
}
/**
- * Make a new model instance.
+ * Get the RootDSE (AD schema) record from the directory.
*
- * @param array $attributes
+ * @param string|null $connection
+ * @return Model
*
- * @return static
+ * @throws \LdapRecord\Models\ModelNotFoundException
*/
- public static function make($attributes = [])
+ public static function getRootDse($connection = null)
{
- return new static($attributes);
+ $model = static::getRootDseModel();
+
+ return $model::on($connection ?? (new $model)->getConnectionName())
+ ->in(null)
+ ->read()
+ ->whereHas('objectclass')
+ ->firstOrFail();
+ }
+
+ /**
+ * Get the root DSE model.
+ *
+ * @return class-string<Model>
+ */
+ protected static function getRootDseModel()
+ {
+ $instance = (new static);
+
+ switch (true) {
+ case $instance instanceof Types\ActiveDirectory:
+ return ActiveDirectory\Entry::class;
+ case $instance instanceof Types\DirectoryServer:
+ return OpenLDAP\Entry::class;
+ case $instance instanceof Types\OpenLDAP:
+ return OpenLDAP\Entry::class;
+ case $instance instanceof Types\FreeIPA:
+ return FreeIPA\Entry::class;
+ default:
+ return Entry::class;
+ }
}
/**
@@ -349,8 +381,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Create a new query builder.
*
- * @param Connection $connection
- *
+ * @param Connection $connection
* @return Builder
*/
public function newQueryBuilder(Connection $connection)
@@ -361,8 +392,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Create a new model instance.
*
- * @param array $attributes
- *
+ * @param array $attributes
* @return static
*/
public function newInstance(array $attributes = [])
@@ -373,8 +403,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Resolve a connection instance.
*
- * @param string|null $connection
- *
+ * @param string|null $connection
* @return Connection
*/
public static function resolveConnection($connection = null)
@@ -405,8 +434,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Set the connection container.
*
- * @param Container $container
- *
+ * @param Container $container
* @return void
*/
public static function setConnectionContainer(Container $container)
@@ -427,8 +455,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Register the query scopes for this builder instance.
*
- * @param Builder $builder
- *
+ * @param Builder $builder
* @return Builder
*/
public function registerModelScopes($builder)
@@ -443,8 +470,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Register the global model scopes.
*
- * @param Builder $builder
- *
+ * @param Builder $builder
* @return Builder
*/
public function registerGlobalScopes($builder)
@@ -459,8 +485,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Apply the model object class scopes to the given builder instance.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return void
*/
public function applyObjectClassScopes(Builder $query)
@@ -483,10 +508,9 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Returns a new batch modification.
*
- * @param string|null $attribute
- * @param string|int|null $type
- * @param array $values
- *
+ * @param string|null $attribute
+ * @param string|int|null $type
+ * @param array $values
* @return BatchModification
*/
public function newBatchModification($attribute = null, $type = null, $values = [])
@@ -497,8 +521,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Returns a new collection with the specified items.
*
- * @param mixed $items
- *
+ * @param mixed $items
* @return Collection
*/
public function newCollection($items = [])
@@ -509,9 +532,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Dynamically retrieve attributes on the object.
*
- * @param mixed $key
- *
- * @return bool
+ * @param string $key
+ * @return mixed
*/
public function __get($key)
{
@@ -521,9 +543,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Dynamically set attributes on the object.
*
- * @param mixed $key
- * @param mixed $value
- *
+ * @param string $key
+ * @param mixed $value
* @return $this
*/
public function __set($key, $value)
@@ -534,8 +555,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if the given offset exists.
*
- * @param string $offset
- *
+ * @param string $offset
* @return bool
*/
#[\ReturnTypeWillChange]
@@ -547,8 +567,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get the value for a given offset.
*
- * @param string $offset
- *
+ * @param string $offset
* @return mixed
*/
#[\ReturnTypeWillChange]
@@ -560,9 +579,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Set the value at the given offset.
*
- * @param string $offset
- * @param mixed $value
- *
+ * @param string $offset
+ * @param mixed $value
* @return void
*/
#[\ReturnTypeWillChange]
@@ -574,8 +592,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Unset the value at the given offset.
*
- * @param string $offset
- *
+ * @param string $offset
* @return void
*/
#[\ReturnTypeWillChange]
@@ -587,8 +604,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if an attribute exists on the model.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function __isset($key)
@@ -599,8 +615,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Unset an attribute on the model.
*
- * @param string $key
- *
+ * @param string $key
* @return void
*/
public function __unset($key)
@@ -630,26 +645,36 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
}
/**
- * Converts extra attributes for JSON serialization.
- *
- * @param array $attributes
+ * Convert the attributes for JSON serialization.
*
+ * @param array $attributes
* @return array
*/
protected function convertAttributesForJson(array $attributes = [])
{
- // If the model has a GUID set, we need to convert
- // it due to it being in binary. Otherwise we'll
- // receive a JSON serialization exception.
- if ($this->hasAttribute($this->guidKey)) {
- return array_replace($attributes, [
- $this->guidKey => [$this->getConvertedGuid()],
- ]);
+ // If the model has a GUID set, we need to convert it to its
+ // string format, due to it being in binary. Otherwise
+ // we will receive a JSON serialization exception.
+ if (isset($attributes[$this->guidKey])) {
+ $attributes[$this->guidKey] = [$this->getConvertedGuid(
+ Arr::first($attributes[$this->guidKey])
+ )];
}
return $attributes;
}
+ /**
+ * Convert the attributes from JSON serialization.
+ *
+ * @param array $attributes
+ * @return array
+ */
+ protected function convertAttributesFromJson(array $attributes = [])
+ {
+ return $attributes;
+ }
+
/**
* Reload a fresh model instance from the directory.
*
@@ -667,8 +692,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if two models have the same distinguished name and belong to the same connection.
*
- * @param Model|null $model
- *
+ * @param Model|null $model
* @return bool
*/
public function is($model)
@@ -681,8 +705,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if two models are not the same.
*
- * @param Model|null $model
- *
+ * @param Model|null $model
* @return bool
*/
public function isNot($model)
@@ -693,8 +716,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Hydrate a new collection of models from search results.
*
- * @param array $records
- *
+ * @param array $records
* @return Collection
*/
public function hydrate($records)
@@ -709,8 +731,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Converts the current model into the given model.
*
- * @param Model $into
- *
+ * @param Model $into
* @return Model
*/
public function convert(self $into)
@@ -760,8 +781,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Set the models batch modifications.
*
- * @param array $modifications
- *
+ * @param array $modifications
* @return $this
*/
public function setModifications(array $modifications = [])
@@ -778,8 +798,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Adds a batch modification to the model.
*
- * @param array|BatchModification $mod
- *
+ * @param array|BatchModification $mod
* @return $this
*
* @throws InvalidArgumentException
@@ -824,8 +843,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get the name of the model, or the given DN.
*
- * @param string|null $dn
- *
+ * @param string|null $dn
* @return string|null
*/
public function getName($dn = null)
@@ -836,8 +854,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get the head attribute of the model, or the given DN.
*
- * @param string|null $dn
- *
+ * @param string|null $dn
* @return string|null
*/
public function getHead($dn = null)
@@ -849,7 +866,6 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
* Get the RDN of the model, of the given DN.
*
* @param string|null
- *
* @return string|null
*/
public function getRdn($dn = null)
@@ -861,7 +877,6 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
* Get the parent distinguished name of the model, or the given DN.
*
* @param string|null
- *
* @return string|null
*/
public function getParentDn($dn = null)
@@ -872,8 +887,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Create a new Distinguished Name object.
*
- * @param string|null $dn
- *
+ * @param string|null $dn
* @return DistinguishedName
*/
public function newDn($dn = null)
@@ -910,28 +924,58 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function getObjectClasses()
{
- return $this->getAttribute('objectclass') ?: [];
+ return $this->getAttribute('objectclass', static::$objectClasses);
}
/**
* Get the model's string GUID.
*
+ * @param string|null $guid
* @return string|null
*/
- public function getConvertedGuid()
+ public function getConvertedGuid($guid = null)
{
try {
- return (string) new Guid($this->getObjectGuid());
+ return (string) $this->newObjectGuid(
+ $guid ?? $this->getObjectGuid()
+ );
} catch (InvalidArgumentException $e) {
return;
}
}
/**
- * Determine if the current model is a direct descendant of the given.
+ * Get the model's binary GUID.
*
- * @param static|string $parent
+ * @param string|null $guid
+ * @return string|null
+ */
+ public function getBinaryGuid($guid = null)
+ {
+ try {
+ return $this->newObjectGuid(
+ $guid ?? $this->getObjectGuid()
+ )->getBinary();
+ } catch (InvalidArgumentException $e) {
+ return;
+ }
+ }
+
+ /**
+ * Make a new object Guid instance.
+ *
+ * @param string $value
+ * @return Guid
+ */
+ protected function newObjectGuid($value)
+ {
+ return new Guid($value);
+ }
+
+ /**
+ * Determine if the current model is a direct descendant of the given.
*
+ * @param static|string $parent
* @return bool
*/
public function isChildOf($parent)
@@ -944,8 +988,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if the current model is a direct ascendant of the given.
*
- * @param static|string $child
- *
+ * @param static|string $child
* @return bool
*/
public function isParentOf($child)
@@ -958,8 +1001,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if the current model is a descendant of the given.
*
- * @param static|string $model
- *
+ * @param static|string $model
* @return bool
*/
public function isDescendantOf($model)
@@ -970,8 +1012,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determine if the current model is a ancestor of the given.
*
- * @param static|string $model
- *
+ * @param static|string $model
* @return bool
*/
public function isAncestorOf($model)
@@ -982,9 +1023,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determines if the DN is inside of the parent DN.
*
- * @param static|string $dn
- * @param static|string $parentDn
- *
+ * @param static|string $dn
+ * @param static|string $parentDn
* @return bool
*/
protected function dnIsInside($dn, $parentDn)
@@ -997,8 +1037,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Set the base DN of where the model should be created in.
*
- * @param static|string $dn
- *
+ * @param static|string $dn
* @return $this
*/
public function inside($dn)
@@ -1011,8 +1050,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Save the model to the directory without raising any events.
*
- * @param array $attributes
- *
+ * @param array $attributes
* @return void
*
* @throws \LdapRecord\LdapRecordException
@@ -1027,8 +1065,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Save the model to the directory.
*
- * @param array $attributes The attributes to update or create for the current entry.
- *
+ * @param array $attributes The attributes to update or create for the current entry.
* @return void
*
* @throws \LdapRecord\LdapRecordException
@@ -1037,11 +1074,13 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
{
$this->fill($attributes);
- $this->fireModelEvent(new Events\Saving($this));
+ $this->dispatch('saving');
$this->exists ? $this->performUpdate() : $this->performInsert();
- $this->fireModelEvent(new Events\Saved($this));
+ $this->dispatch('saved');
+
+ $this->modifications = [];
$this->in = null;
}
@@ -1071,7 +1110,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
$this->setDn($this->getCreatableDn());
}
- $this->fireModelEvent(new Events\Creating($this));
+ $this->dispatch('creating');
// Here we perform the insert of new object in the directory,
// but filter out any empty attributes before sending them
@@ -1079,7 +1118,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
// attributes have been given empty or null values.
$query->insert($this->getDn(), array_filter($this->getAttributes()));
- $this->fireModelEvent(new Events\Created($this));
+ $this->dispatch('created');
$this->syncOriginal();
@@ -1101,22 +1140,19 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
return;
}
- $this->fireModelEvent(new Events\Updating($this));
+ $this->dispatch('updating');
$this->newQuery()->update($this->dn, $modifications);
- $this->fireModelEvent(new Events\Updated($this));
+ $this->dispatch('updated');
$this->syncOriginal();
-
- $this->modifications = [];
}
/**
* Create the model in the directory.
*
- * @param array $attributes The attributes for the new entry.
- *
+ * @param array $attributes The attributes for the new entry.
* @return Model
*
* @throws \LdapRecord\LdapRecordException
@@ -1133,9 +1169,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Create an attribute on the model.
*
- * @param string $attribute The attribute to create
- * @param mixed $value The value of the new attribute
- *
+ * @param string $attribute The attribute to create
+ * @param mixed $value The value of the new attribute
* @return void
*
* @throws ModelDoesNotExistException
@@ -1143,18 +1178,21 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function createAttribute($attribute, $value)
{
- $this->requireExistence();
+ $this->assertExists();
+
+ $this->dispatch(['saving', 'updating']);
$this->newQuery()->insertAttributes($this->dn, [$attribute => (array) $value]);
$this->addAttributeValue($attribute, $value);
+
+ $this->dispatch(['updated', 'saved']);
}
/**
* Update the model.
*
- * @param array $attributes The attributes to update for the current entry.
- *
+ * @param array $attributes The attributes to update for the current entry.
* @return void
*
* @throws ModelDoesNotExistException
@@ -1162,7 +1200,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function update(array $attributes = [])
{
- $this->requireExistence();
+ $this->assertExists();
$this->save($attributes);
}
@@ -1170,9 +1208,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Update the model attribute with the specified value.
*
- * @param string $attribute The attribute to modify
- * @param mixed $value The new value for the attribute
- *
+ * @param string $attribute The attribute to modify
+ * @param mixed $value The new value for the attribute
* @return void
*
* @throws ModelDoesNotExistException
@@ -1180,19 +1217,22 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function updateAttribute($attribute, $value)
{
- $this->requireExistence();
+ $this->assertExists();
+
+ $this->dispatch(['saving', 'updating']);
$this->newQuery()->updateAttributes($this->dn, [$attribute => (array) $value]);
$this->addAttributeValue($attribute, $value);
+
+ $this->dispatch(['updated', 'saved']);
}
/**
* Destroy the models for the given distinguished names.
*
- * @param Collection|array|string $dns
- * @param bool $recursive
- *
+ * @param Collection|array|string $dns
+ * @param bool $recursive
* @return int
*
* @throws \LdapRecord\LdapRecordException
@@ -1201,11 +1241,17 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
{
$count = 0;
- $dns = is_string($dns) ? (array) $dns : $dns;
-
$instance = new static();
- foreach ($dns as $dn) {
+ if ($dns instanceof Collection) {
+ $dns = $dns->modelDns()->toArray();
+ }
+
+ // Here we are iterating through each distinguished name and locating
+ // the associated model. While it's more resource intensive, we must
+ // do this in case of leaf nodes being given alongside any parent
+ // node, ensuring they can be deleted inside of the directory.
+ foreach ((array) $dns as $dn) {
if (! $model = $instance->find($dn)) {
continue;
}
@@ -1224,8 +1270,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
* Throws a ModelNotFoundException if the current model does
* not exist or does not contain a distinguished name.
*
- * @param bool $recursive Whether to recursively delete leaf nodes (models that are children).
- *
+ * @param bool $recursive Whether to recursively delete leaf nodes (models that are children).
* @return void
*
* @throws ModelDoesNotExistException
@@ -1233,9 +1278,9 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function delete($recursive = false)
{
- $this->requireExistence();
+ $this->assertExists();
- $this->fireModelEvent(new Events\Deleting($this));
+ $this->dispatch('deleting');
if ($recursive) {
$this->deleteLeafNodes();
@@ -1248,7 +1293,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
// developers can hook in and run further operations.
$this->exists = false;
- $this->fireModelEvent(new Events\Deleted($this));
+ $this->dispatch('deleted');
}
/**
@@ -1263,15 +1308,15 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
$this->newQueryWithoutScopes()
->in($this->dn)
->listing()
- ->chunk(250, function ($models) {
- $models->each->delete($recursive = true);
+ ->each(function (Model $model) {
+ $model->delete($recursive = true);
});
}
/**
* Delete an attribute on the model.
*
- * @param string|array $attributes The attribute(s) to delete
+ * @param string|array $attributes The attribute(s) to delete
*
* Delete specific values in attributes:
*
@@ -1280,7 +1325,6 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
* Delete an entire attribute:
*
* ["memberuid" => []]
- *
* @return void
*
* @throws ModelDoesNotExistException
@@ -1288,10 +1332,12 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function deleteAttribute($attributes)
{
- $this->requireExistence();
+ $this->assertExists();
$attributes = $this->makeDeletableAttributes($attributes);
+ $this->dispatch(['saving', 'updating']);
+
$this->newQuery()->deleteAttributes($this->dn, $attributes);
foreach ($attributes as $attribute => $value) {
@@ -1311,14 +1357,15 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
}
}
+ $this->dispatch(['updated', 'saved']);
+
$this->syncOriginal();
}
/**
* Make a deletable attribute array.
*
- * @param string|array $attributes
- *
+ * @param string|array $attributes
* @return array
*/
protected function makeDeletableAttributes($attributes)
@@ -1339,9 +1386,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*
* For example: $user->move($ou);
*
- * @param static|string $newParentDn The new parent of the current model.
- * @param bool $deleteOldRdn Whether to delete the old models relative distinguished name once renamed / moved.
- *
+ * @param static|string $newParentDn The new parent of the current model.
+ * @param bool $deleteOldRdn Whether to delete the old models relative distinguished name once renamed / moved.
* @return void
*
* @throws UnexpectedValueException
@@ -1350,7 +1396,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function move($newParentDn, $deleteOldRdn = true)
{
- $this->requireExistence();
+ $this->assertExists();
if (! $rdn = $this->getRdn()) {
throw new UnexpectedValueException('Current model does not contain an RDN to move.');
@@ -1362,10 +1408,9 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Rename the model to a new RDN and new parent.
*
- * @param string $rdn The models new relative distinguished name. Example: "cn=JohnDoe"
- * @param static|string|null $newParentDn The models new parent distinguished name (if moving). Leave this null if you are only renaming. Example: "ou=MovedUsers,dc=acme,dc=org"
- * @param bool|true $deleteOldRdn Whether to delete the old models relative distinguished name once renamed / moved.
- *
+ * @param string $rdn The models new relative distinguished name. Example: "cn=JohnDoe"
+ * @param static|string|null $newParentDn The models new parent distinguished name (if moving). Leave this null if you are only renaming. Example: "ou=MovedUsers,dc=acme,dc=org"
+ * @param bool|true $deleteOldRdn Whether to delete the old models relative distinguished name once renamed / moved.
* @return void
*
* @throws ModelDoesNotExistException
@@ -1373,7 +1418,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
*/
public function rename($rdn, $newParentDn = null, $deleteOldRdn = true)
{
- $this->requireExistence();
+ $this->assertExists();
if ($newParentDn instanceof self) {
$newParentDn = $newParentDn->getDn();
@@ -1400,7 +1445,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
$rdn = $this->getUpdateableRdn($rdn);
}
- $this->fireModelEvent(new Renaming($this, $rdn, $newParentDn));
+ $this->dispatch('renaming', [$rdn, $newParentDn]);
$this->newQuery()->rename($this->dn, $rdn, $newParentDn, $deleteOldRdn);
@@ -1420,7 +1465,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
= $this->original[$modelNameAttribute]
= [reset($map[$modelNameAttribute])];
- $this->fireModelEvent(new Renamed($this));
+ $this->dispatch('renamed');
$this->wasRecentlyRenamed = true;
}
@@ -1428,8 +1473,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get an updateable RDN for the model.
*
- * @param string $name
- *
+ * @param string $name
* @return string
*/
public function getUpdateableRdn($name)
@@ -1440,9 +1484,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get a distinguished name that is creatable for the model.
*
- * @param string|null $name
- * @param string|null $attribute
- *
+ * @param string|null $name
+ * @param string|null $attribute
* @return string
*/
public function getCreatableDn($name = null, $attribute = null)
@@ -1456,9 +1499,8 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Get a creatable (escaped) RDN for the model.
*
- * @param string|null $name
- * @param string|null $attribute
- *
+ * @param string|null $name
+ * @param string|null $attribute
* @return string
*/
public function getCreatableRdn($name = null, $attribute = null)
@@ -1485,8 +1527,7 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Determines if the given modification is valid.
*
- * @param mixed $mod
- *
+ * @param mixed $mod
* @return bool
*/
protected function isValidModification($mod)
@@ -1528,11 +1569,25 @@ abstract class Model implements ArrayAccess, Arrayable, JsonSerializable
/**
* Throw an exception if the model does not exist.
*
+ * @deprecated
+ *
* @return void
*
* @throws ModelDoesNotExistException
*/
protected function requireExistence()
+ {
+ return $this->assertExists();
+ }
+
+ /**
+ * Throw an exception if the model does not exist.
+ *
+ * @return void
+ *
+ * @throws ModelDoesNotExistException
+ */
+ protected function assertExists()
{
if (! $this->exists || is_null($this->dn)) {
throw ModelDoesNotExistException::forModel($this);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ModelDoesNotExistException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ModelDoesNotExistException.php
index 2dd2ba9b..50841491 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ModelDoesNotExistException.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/ModelDoesNotExistException.php
@@ -16,8 +16,7 @@ class ModelDoesNotExistException extends LdapRecordException
/**
* Create a new exception for the given model.
*
- * @param Model $model
- *
+ * @param Model $model
* @return ModelDoesNotExistException
*/
public static function forModel(Model $model)
@@ -28,8 +27,7 @@ class ModelDoesNotExistException extends LdapRecordException
/**
* Set the model that does not exist.
*
- * @param Model $model
- *
+ * @param Model $model
* @return ModelDoesNotExistException
*/
public function setModel(Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Entry.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Entry.php
index b7ad37a4..c11ca72d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Entry.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Entry.php
@@ -34,8 +34,7 @@ class Entry extends BaseEntry implements OpenLDAP
/**
* Create a new query builder.
*
- * @param Connection $connection
- *
+ * @param Connection $connection
* @return OpenLdapBuilder
*/
public function newQueryBuilder(Connection $connection)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Group.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Group.php
index 2d8d94e3..a9a682a0 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Group.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Group.php
@@ -13,4 +13,16 @@ class Group extends Entry
'top',
'groupofuniquenames',
];
+
+ /**
+ * The members relationship.
+ *
+ * Retrieves members that are apart of the group.
+ *
+ * @return \LdapRecord\Models\Relations\HasMany
+ */
+ public function members()
+ {
+ return $this->hasMany([static::class, User::class], 'memberUid');
+ }
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Scopes/AddEntryUuidToSelects.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Scopes/AddEntryUuidToSelects.php
index 54376c2b..780a633f 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Scopes/AddEntryUuidToSelects.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/Scopes/AddEntryUuidToSelects.php
@@ -11,9 +11,8 @@ class AddEntryUuidToSelects implements Scope
/**
* Add the entry UUID to the selected attributes.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/User.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/User.php
index b37f3905..c8626de6 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/User.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/OpenLDAP/User.php
@@ -40,7 +40,7 @@ class User extends Entry implements Authenticatable
/**
* The groups relationship.
*
- * Retrieves groups that the user is apart of.
+ * Retrieve groups that the user is a part of.
*
* @return \LdapRecord\Models\Relations\HasMany
*/
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php
index ae36720c..583f81c3 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasMany.php
@@ -5,9 +5,9 @@ namespace LdapRecord\Models\Relations;
use Closure;
use LdapRecord\DetectsErrors;
use LdapRecord\LdapRecordException;
+use LdapRecord\Models\Collection;
use LdapRecord\Models\Model;
use LdapRecord\Models\ModelNotFoundException;
-use LdapRecord\Query\Collection;
class HasMany extends OneToMany
{
@@ -51,9 +51,8 @@ class HasMany extends OneToMany
/**
* Set the model and attribute to use for attaching / detaching.
*
- * @param Model $using
- * @param string $usingKey
- *
+ * @param Model $using
+ * @param string $usingKey
* @return $this
*/
public function using(Model $using, $usingKey)
@@ -67,8 +66,7 @@ class HasMany extends OneToMany
/**
* Set the pagination page size of the relation query.
*
- * @param int $pageSize
- *
+ * @param int $pageSize
* @return $this
*/
public function setPageSize($pageSize)
@@ -81,8 +79,7 @@ class HasMany extends OneToMany
/**
* Paginate the relation using the given page size.
*
- * @param int $pageSize
- *
+ * @param int $pageSize
* @return Collection
*/
public function paginate($pageSize = 1000)
@@ -93,8 +90,7 @@ class HasMany extends OneToMany
/**
* Paginate the relation using the page size once.
*
- * @param int $pageSize
- *
+ * @param int $pageSize
* @return Collection
*/
protected function paginateOnceUsing($pageSize)
@@ -109,17 +105,66 @@ class HasMany extends OneToMany
}
/**
- * Chunk the relation results using the given callback.
+ * Execute a callback over each result while chunking.
*
- * @param int $pageSize
- * @param Closure $callback
+ * @param Closure $callback
+ * @param int $pageSize
+ * @return bool
+ */
+ public function each(Closure $callback, $pageSize = 1000)
+ {
+ $this->chunk($pageSize, function ($results) use ($callback) {
+ foreach ($results as $key => $value) {
+ if ($callback($value, $key) === false) {
+ return false;
+ }
+ }
+ });
+ }
+
+ /**
+ * Chunk the relation results using the given callback.
*
- * @return void
+ * @param int $pageSize
+ * @param Closure $callback
+ * @param array $loaded
+ * @return bool
*/
public function chunk($pageSize, Closure $callback)
{
- $this->getRelationQuery()->chunk($pageSize, function ($entries) use ($callback) {
- $callback($this->transformResults($entries));
+ return $this->chunkRelation($pageSize, $callback);
+ }
+
+ /**
+ * Execute the callback over chunks of relation results.
+ *
+ * @param int $pageSize
+ * @param Closure $callback
+ * @param array $loaded
+ * @return bool
+ */
+ protected function chunkRelation($pageSize, Closure $callback, $loaded = [])
+ {
+ return $this->getRelationQuery()->chunk($pageSize, function (Collection $results) use ($pageSize, $callback, $loaded) {
+ $models = $this->transformResults($results)->when($this->recursive, function (Collection $models) use ($loaded) {
+ return $models->reject(function (Model $model) use ($loaded) {
+ return in_array($model->getDn(), $loaded);
+ });
+ });
+
+ if ($callback($models) === false) {
+ return false;
+ }
+
+ $models->when($this->recursive, function (Collection $models) use ($pageSize, $callback, $loaded) {
+ $models->each(function (Model $model) use ($pageSize, $callback, $loaded) {
+ if ($relation = $model->getRelation($this->relationName)) {
+ $loaded[] = $model->getDn();
+
+ return $relation->recursive()->chunkRelation($pageSize, $callback, $loaded);
+ }
+ });
+ });
});
}
@@ -168,8 +213,7 @@ class HasMany extends OneToMany
/**
* Attach a model to the relation.
*
- * @param Model|string $model
- *
+ * @param Model|string $model
* @return Model|string|false
*/
public function attach($model)
@@ -184,8 +228,7 @@ class HasMany extends OneToMany
/**
* Build the attach callback.
*
- * @param Model|string $model
- *
+ * @param Model|string $model
* @return \Closure
*/
protected function buildAttachCallback($model)
@@ -208,8 +251,7 @@ class HasMany extends OneToMany
/**
* Attach a collection of models to the parent instance.
*
- * @param iterable $models
- *
+ * @param iterable $models
* @return iterable
*/
public function attachMany($models)
@@ -224,8 +266,7 @@ class HasMany extends OneToMany
/**
* Detach the model from the relation.
*
- * @param Model|string $model
- *
+ * @param Model|string $model
* @return Model|string|false
*/
public function detach($model)
@@ -238,10 +279,28 @@ class HasMany extends OneToMany
}
/**
- * Build the detach callback.
+ * Detach the model or delete the parent if the relation is empty.
*
- * @param Model|string $model
+ * @param Model|string $model
+ * @return void
+ */
+ public function detachOrDeleteParent($model)
+ {
+ $count = $this->onceWithoutMerging(function () {
+ return $this->count();
+ });
+
+ if ($count <= 1) {
+ return $this->getParent()->delete();
+ }
+
+ return $this->detach($model);
+ }
+
+ /**
+ * Build the detach callback.
*
+ * @param Model|string $model
* @return \Closure
*/
protected function buildDetachCallback($model)
@@ -264,8 +323,7 @@ class HasMany extends OneToMany
/**
* Get the attachable foreign value from the model.
*
- * @param Model|string $model
- *
+ * @param Model|string $model
* @return string
*/
protected function getAttachableForeignValue($model)
@@ -282,8 +340,7 @@ class HasMany extends OneToMany
/**
* Get the foreign model by the given value, or fail.
*
- * @param string $model
- *
+ * @param string $model
* @return Model
*
* @throws ModelNotFoundException
@@ -305,10 +362,9 @@ class HasMany extends OneToMany
*
* If a bypassable exception is encountered, the value will be returned.
*
- * @param callable $operation
- * @param string|array $bypass
- * @param mixed $value
- *
+ * @param callable $operation
+ * @param string|array $bypass
+ * @param mixed $value
* @return mixed
*
* @throws LdapRecordException
@@ -341,4 +397,24 @@ class HasMany extends OneToMany
});
});
}
+
+ /**
+ * Detach all relation models or delete the model if its relation is empty.
+ *
+ * @return Collection
+ */
+ public function detachAllOrDelete()
+ {
+ return $this->onceWithoutMerging(function () {
+ return $this->get()->each(function (Model $model) {
+ $relation = $model->getRelation($this->relationName);
+
+ if ($relation && $relation->count() >= 1) {
+ $model->delete();
+ } else {
+ $this->detach($model);
+ }
+ });
+ });
+ }
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php
index 7bad4ab6..243cd2ed 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/HasOne.php
@@ -25,8 +25,7 @@ class HasOne extends Relation
/**
* Attach a model instance to the parent model.
*
- * @param Model|string $model
- *
+ * @param Model|string $model
* @return Model|string
*
* @throws \LdapRecord\LdapRecordException
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php
index 6d14c857..aa873b60 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/OneToMany.php
@@ -32,12 +32,12 @@ abstract class OneToMany extends Relation
/**
* Constructor.
*
- * @param Builder $query
- * @param Model $parent
- * @param string $related
- * @param string $relationKey
- * @param string $foreignKey
- * @param string $relationName
+ * @param Builder $query
+ * @param Model $parent
+ * @param string $related
+ * @param string $relationKey
+ * @param string $foreignKey
+ * @param string $relationName
*/
public function __construct(Builder $query, Model $parent, $related, $relationKey, $foreignKey, $relationName)
{
@@ -49,8 +49,7 @@ abstract class OneToMany extends Relation
/**
* Set the relation to load with its parent.
*
- * @param Relation $relation
- *
+ * @param Relation $relation
* @return $this
*/
public function with(Relation $relation)
@@ -63,8 +62,7 @@ abstract class OneToMany extends Relation
/**
* Whether to include recursive results.
*
- * @param bool $enable
- *
+ * @param bool $enable
* @return $this
*/
public function recursive($enable = true)
@@ -100,8 +98,7 @@ abstract class OneToMany extends Relation
/**
* Execute the callback excluding the merged query result.
*
- * @param callable $callback
- *
+ * @param callable $callback
* @return mixed
*/
protected function onceWithoutMerging($callback)
@@ -142,8 +139,7 @@ abstract class OneToMany extends Relation
/**
* Get the results for the models relation recursively.
*
- * @param string[] $loaded The distinguished names of models already loaded
- *
+ * @param string[] $loaded The distinguished names of models already loaded
* @return Collection
*/
protected function getRecursiveResults(array $loaded = [])
@@ -172,15 +168,14 @@ abstract class OneToMany extends Relation
/**
* Get the recursive relation results for given model.
*
- * @param Model $model
- * @param array $loaded
- *
+ * @param Model $model
+ * @param array $loaded
* @return Collection
*/
protected function getRecursiveRelationResults(Model $model, array $loaded)
{
- return method_exists($model, $this->relationName)
- ? $model->{$this->relationName}()->getRecursiveResults($loaded)
+ return ($relation = $model->getRelation($this->relationName))
+ ? $relation->getRecursiveResults($loaded)
: $model->newCollection();
}
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/Relation.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/Relation.php
index 1b108fd9..31b0969c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/Relation.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Relations/Relation.php
@@ -2,6 +2,7 @@
namespace LdapRecord\Models\Relations;
+use Closure;
use LdapRecord\Models\Entry;
use LdapRecord\Models\Model;
use LdapRecord\Query\Collection;
@@ -9,7 +10,8 @@ use LdapRecord\Query\Model\Builder;
/**
* @method bool exists($models = null) Determine if the relation contains all of the given models, or any models
- * @method bool contains($models) Determine if any of the given models are contained in the relation
+ * @method bool contains($models) Determine if any of the given models are contained in the relation
+ * @method bool count() Retrieve the "count" result of the query.
*/
abstract class Relation
{
@@ -28,7 +30,7 @@ abstract class Relation
protected $parent;
/**
- * The related models.
+ * The related model class names.
*
* @var array
*/
@@ -55,14 +57,28 @@ abstract class Relation
*/
protected $default = Entry::class;
+ /**
+ * The callback to use for resolving relation models.
+ *
+ * @var Closure
+ */
+ protected static $modelResolver;
+
+ /**
+ * The methods that should be passed along to a relation collection.
+ *
+ * @var string[]
+ */
+ protected $passthru = ['count', 'exists', 'contains'];
+
/**
* Constructor.
*
- * @param Builder $query
- * @param Model $parent
- * @param mixed $related
- * @param string $relationKey
- * @param string $foreignKey
+ * @param Builder $query
+ * @param Model $parent
+ * @param string|array $related
+ * @param string $relationKey
+ * @param string $foreignKey
*/
public function __construct(Builder $query, Model $parent, $related, $relationKey, $foreignKey)
{
@@ -72,20 +88,23 @@ abstract class Relation
$this->relationKey = $relationKey;
$this->foreignKey = $foreignKey;
+ static::$modelResolver = static::$modelResolver ?? function (array $modelObjectClasses, array $relationMap) {
+ return array_search($modelObjectClasses, $relationMap);
+ };
+
$this->initRelation();
}
/**
* Handle dynamic method calls to the relationship.
*
- * @param string $method
- * @param array $parameters
- *
+ * @param string $method
+ * @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
- if (in_array($method, ['exists', 'contains'])) {
+ if (in_array($method, $this->passthru)) {
return $this->get('objectclass')->$method(...$parameters);
}
@@ -98,6 +117,45 @@ abstract class Relation
return $result;
}
+ /**
+ * Set the callback to use for resolving models from relation results.
+ *
+ * @param Closure $callback
+ * @return void
+ */
+ public static function resolveModelsUsing(Closure $callback)
+ {
+ static::$modelResolver = $callback;
+ }
+
+ /**
+ * Only return objects matching the related model's object classes.
+ *
+ * @return $this
+ */
+ public function onlyRelated()
+ {
+ $relations = [];
+
+ foreach ($this->related as $related) {
+ $relations[$related] = $related::$objectClasses;
+ }
+
+ $relations = array_filter($relations);
+
+ if (empty($relations)) {
+ return $this;
+ }
+
+ $this->query->andFilter(function (Builder $query) use ($relations) {
+ foreach ($relations as $relation => $objectClasses) {
+ $query->whereIn('objectclass', $objectClasses);
+ }
+ });
+
+ return $this;
+ }
+
/**
* Get the results of the relationship.
*
@@ -108,8 +166,7 @@ abstract class Relation
/**
* Execute the relationship query.
*
- * @param array|string $columns
- *
+ * @param array|string $columns
* @return Collection
*/
public function get($columns = ['*'])
@@ -122,8 +179,7 @@ abstract class Relation
*
* If the query columns are empty, the given columns are applied.
*
- * @param array $columns
- *
+ * @param array $columns
* @return Collection
*/
protected function getResultsWithColumns($columns)
@@ -138,8 +194,7 @@ abstract class Relation
/**
* Get the first result of the relationship.
*
- * @param array|string $columns
- *
+ * @param array|string $columns
* @return Model|null
*/
public function first($columns = ['*'])
@@ -162,6 +217,21 @@ abstract class Relation
return $this;
}
+ /**
+ * Set the underlying query for the relation.
+ *
+ * @param Builder $query
+ * @return $this
+ */
+ public function setQuery(Builder $query)
+ {
+ $this->query = $query;
+
+ $this->initRelation();
+
+ return $this;
+ }
+
/**
* Get the underlying query for the relation.
*
@@ -239,8 +309,7 @@ abstract class Relation
/**
* Get the foreign model by the given value.
*
- * @param string $value
- *
+ * @param string $value
* @return Model|null
*/
protected function getForeignModelByValue($value)
@@ -253,8 +322,7 @@ abstract class Relation
/**
* Returns the escaped foreign key value for use in an LDAP filter from the model.
*
- * @param Model $model
- *
+ * @param Model $model
* @return string
*/
protected function getEscapedForeignValueFromModel(Model $model)
@@ -277,8 +345,7 @@ abstract class Relation
/**
* Get the foreign key value from the model.
*
- * @param Model $model
- *
+ * @param Model $model
* @return string
*/
protected function getForeignValueFromModel(Model $model)
@@ -291,9 +358,8 @@ abstract class Relation
/**
* Get the first attribute value from the model.
*
- * @param Model $model
- * @param string $attribute
- *
+ * @param Model $model
+ * @param string $attribute
* @return string|null
*/
protected function getFirstAttributeValue(Model $model, $attribute)
@@ -304,20 +370,21 @@ abstract class Relation
/**
* Transforms the results by converting the models into their related.
*
- * @param Collection $results
- *
+ * @param Collection $results
* @return Collection
*/
protected function transformResults(Collection $results)
{
- $related = [];
+ $relationMap = [];
foreach ($this->related as $relation) {
- $related[$relation] = $relation::$objectClasses;
+ $relationMap[$relation] = $this->normalizeObjectClasses(
+ $relation::$objectClasses
+ );
}
- return $results->transform(function (Model $entry) use ($related) {
- $model = $this->determineModelFromRelated($entry, $related);
+ return $results->transform(function (Model $entry) use ($relationMap) {
+ $model = $this->determineModelFromRelated($entry, $relationMap);
return class_exists($model) ? $entry->convert(new $model()) : $entry;
});
@@ -334,29 +401,33 @@ abstract class Relation
}
/**
- * Determines the model from the given relations.
- *
- * @param Model $model
- * @param array $related
+ * Determines the model from the given relation map.
*
- * @return string|bool
+ * @param Model $model
+ * @param array $relationMap
+ * @return class-string|bool
*/
- protected function determineModelFromRelated(Model $model, array $related)
+ protected function determineModelFromRelated(Model $model, array $relationMap)
{
// We must normalize all the related models object class
// names to the same case so we are able to properly
// determine the owning model from search results.
- return array_search(
- $this->normalizeObjectClasses($model->getObjectClasses()),
- array_map([$this, 'normalizeObjectClasses'], $related)
+ $modelObjectClasses = $this->normalizeObjectClasses(
+ $model->getObjectClasses()
+ );
+
+ return call_user_func(
+ static::$modelResolver,
+ $modelObjectClasses,
+ $relationMap,
+ $model,
);
}
/**
* Sort and normalize the object classes.
*
- * @param array $classes
- *
+ * @param array $classes
* @return array
*/
protected function normalizeObjectClasses($classes)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Scope.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Scope.php
index 321cae35..f61cf686 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Scope.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Scope.php
@@ -9,9 +9,8 @@ interface Scope
/**
* Apply the scope to the given query.
*
- * @param Builder $query
- * @param Model $model
- *
+ * @param Builder $query
+ * @param Model $model
* @return void
*/
public function apply(Builder $query, Model $model);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/ActiveDirectory.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/ActiveDirectory.php
index 61d21ef2..3edcf88c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/ActiveDirectory.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/ActiveDirectory.php
@@ -23,7 +23,16 @@ interface ActiveDirectory extends TypeInterface
/**
* Returns the model's SID.
*
+ * @param string|null $sid
* @return string|null
*/
- public function getConvertedSid();
+ public function getConvertedSid($sid = null);
+
+ /**
+ * Returns the model's binary SID.
+ *
+ * @param string|null $sid
+ * @return string|null
+ */
+ public function getBinarySid($sid = null);
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/DirectoryServer.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/DirectoryServer.php
new file mode 100644
index 00000000..f06216cd
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Models/Types/DirectoryServer.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace LdapRecord\Models\Types;
+
+interface DirectoryServer extends TypeInterface
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ArrayCacheStore.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ArrayCacheStore.php
index d7480a7b..2fb9c9a7 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ArrayCacheStore.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ArrayCacheStore.php
@@ -53,8 +53,7 @@ class ArrayCacheStore implements CacheInterface
/**
* Get the expiration time of the key.
*
- * @param int $seconds
- *
+ * @param int $seconds
* @return int
*/
protected function calculateExpiration($seconds)
@@ -65,8 +64,7 @@ class ArrayCacheStore implements CacheInterface
/**
* Get the UNIX timestamp for the given number of seconds.
*
- * @param int $seconds
- *
+ * @param int $seconds
* @return int
*/
protected function toTimestamp($seconds)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php
index b9e31960..c93c1780 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Builder.php
@@ -20,7 +20,6 @@ use LdapRecord\Query\Pagination\Paginator;
use LdapRecord\Support\Arr;
use LdapRecord\Utilities;
-/** @psalm-suppress UndefinedClass */
class Builder
{
use EscapesValues;
@@ -144,7 +143,7 @@ class Builder
/**
* Constructor.
*
- * @param Connection $connection
+ * @param Connection $connection
*/
public function __construct(Connection $connection)
{
@@ -155,8 +154,7 @@ class Builder
/**
* Set the current connection.
*
- * @param Connection $connection
- *
+ * @param Connection $connection
* @return $this
*/
public function setConnection(Connection $connection)
@@ -169,8 +167,7 @@ class Builder
/**
* Set the current filter grammar.
*
- * @param Grammar $grammar
- *
+ * @param Grammar $grammar
* @return $this
*/
public function setGrammar(Grammar $grammar)
@@ -183,8 +180,7 @@ class Builder
/**
* Set the cache to store query results.
*
- * @param Cache|null $cache
- *
+ * @param Cache|null $cache
* @return $this
*/
public function setCache(Cache $cache = null)
@@ -197,8 +193,7 @@ class Builder
/**
* Returns a new Query Builder instance.
*
- * @param string $baseDn
- *
+ * @param string $baseDn
* @return $this
*/
public function newInstance($baseDn = null)
@@ -213,8 +208,7 @@ class Builder
/**
* Returns a new nested Query Builder instance.
*
- * @param Closure|null $closure
- *
+ * @param Closure|null $closure
* @return $this
*/
public function newNestedInstance(Closure $closure = null)
@@ -231,8 +225,7 @@ class Builder
/**
* Executes the LDAP query.
*
- * @param string|array $columns
- *
+ * @param string|array $columns
* @return Collection|array
*/
public function get($columns = ['*'])
@@ -247,9 +240,8 @@ class Builder
*
* After running the callback, the columns are reset to the original value.
*
- * @param array $columns
- * @param Closure $callback
- *
+ * @param array $columns
+ * @param Closure $callback
* @return mixed
*/
protected function onceWithColumns($columns, Closure $callback)
@@ -336,8 +328,7 @@ class Builder
/**
* Set the base distinguished name of the query.
*
- * @param Model|string $dn
- *
+ * @param Model|string $dn
* @return $this
*/
public function setBaseDn($dn)
@@ -370,8 +361,7 @@ class Builder
/**
* Set the distinguished name for the query.
*
- * @param string|Model|null $dn
- *
+ * @param string|Model|null $dn
* @return $this
*/
public function setDn($dn = null)
@@ -384,8 +374,7 @@ class Builder
/**
* Substitute the base DN string template for the current base.
*
- * @param Model|string $dn
- *
+ * @param Model|string $dn
* @return string
*/
protected function substituteBaseInDn($dn)
@@ -400,8 +389,7 @@ class Builder
/**
* Alias for setting the distinguished name for the query.
*
- * @param string|Model|null $dn
- *
+ * @param string|Model|null $dn
* @return $this
*/
public function in($dn = null)
@@ -412,8 +400,7 @@ class Builder
/**
* Set the size limit of the current query.
*
- * @param int $limit
- *
+ * @param int $limit
* @return $this
*/
public function limit($limit = 0)
@@ -426,8 +413,7 @@ class Builder
/**
* Returns a new query for the given model.
*
- * @param Model $model
- *
+ * @param Model $model
* @return ModelBuilder
*/
public function model(Model $model)
@@ -441,8 +427,7 @@ class Builder
/**
* Performs the specified query on the current LDAP connection.
*
- * @param string $query
- *
+ * @param string $query
* @return Collection|array
*/
public function query($query)
@@ -466,9 +451,8 @@ class Builder
/**
* Paginates the current LDAP query.
*
- * @param int $pageSize
- * @param bool $isCritical
- *
+ * @param int $pageSize
+ * @param bool $isCritical
* @return Collection|array
*/
public function paginate($pageSize = 1000, $isCritical = false)
@@ -496,10 +480,9 @@ class Builder
/**
* Runs the paginate operation with the given filter.
*
- * @param string $filter
- * @param int $perPage
- * @param bool $isCritical
- *
+ * @param string $filter
+ * @param int $perPage
+ * @param bool $isCritical
* @return array
*/
protected function runPaginate($filter, $perPage, $isCritical)
@@ -512,46 +495,51 @@ class Builder
/**
* Execute a callback over each item while chunking.
*
- * @param Closure $callback
- * @param int $count
- *
+ * @param Closure $callback
+ * @param int $pageSize
+ * @param bool $isCritical
+ * @param bool $isolate
* @return bool
*/
- public function each(Closure $callback, $count = 1000)
+ public function each(Closure $callback, $pageSize = 1000, $isCritical = false, $isolate = false)
{
- return $this->chunk($count, function ($results) use ($callback) {
+ return $this->chunk($pageSize, function ($results) use ($callback) {
foreach ($results as $key => $value) {
if ($callback($value, $key) === false) {
return false;
}
}
- });
+ }, $isCritical, $isolate);
}
/**
* Chunk the results of a paginated LDAP query.
*
- * @param int $pageSize
- * @param Closure $callback
- * @param bool $isCritical
- *
+ * @param int $pageSize
+ * @param Closure $callback
+ * @param bool $isCritical
+ * @param bool $isolate
* @return bool
*/
- public function chunk($pageSize, Closure $callback, $isCritical = false)
+ public function chunk($pageSize, Closure $callback, $isCritical = false, $isolate = false)
{
$start = microtime(true);
- $query = $this->getQuery();
+ $chunk = function (Builder $query) use ($pageSize, $callback, $isCritical) {
+ $page = 1;
- $page = 1;
+ foreach ($query->runChunk($this->getQuery(), $pageSize, $isCritical) as $chunk) {
+ if ($callback($this->process($chunk), $page) === false) {
+ return false;
+ }
- foreach ($this->runChunk($query, $pageSize, $isCritical) as $chunk) {
- if ($callback($this->process($chunk), $page) === false) {
- return false;
+ $page++;
}
+ };
- $page++;
- }
+ $isolate ? $this->connection->isolate(function (Connection $replicate) use ($chunk) {
+ $chunk($this->clone()->setConnection($replicate));
+ }) : $chunk($this);
$this->logQuery($this, 'chunk', $this->getElapsedTime($start));
@@ -561,11 +549,10 @@ class Builder
/**
* Runs the chunk operation with the given filter.
*
- * @param string $filter
- * @param int $perPage
- * @param bool $isCritical
- *
- * @return array
+ * @param string $filter
+ * @param int $perPage
+ * @param bool $isCritical
+ * @return \Generator
*/
protected function runChunk($filter, $perPage, $isCritical)
{
@@ -575,10 +562,60 @@ class Builder
}
/**
- * Processes and converts the given LDAP results into models.
+ * Create a slice of the LDAP query into a page.
*
- * @param array $results
+ * @param int $page
+ * @param int $perPage
+ * @param string $orderBy
+ * @param string $orderByDir
+ * @return Slice
+ */
+ public function slice($page = 1, $perPage = 100, $orderBy = 'cn', $orderByDir = 'asc')
+ {
+ $results = $this->forPage($page, $perPage, $orderBy, $orderByDir);
+
+ $total = $this->controlsResponse[LDAP_CONTROL_VLVRESPONSE]['value']['count'] ?? 0;
+
+ // Some LDAP servers seem to have an issue where the last result in a virtual
+ // list view will always be returned, regardless of the offset being larger
+ // than the result itself. In this case, we will manually return an empty
+ // response so that no objects are deceivingly included in the slice.
+ $objects = $page > max((int) ceil($total / $perPage), 1)
+ ? ($this instanceof ModelBuilder ? $this->model->newCollection() : [])
+ : $results;
+
+ return new Slice($objects, $total, $perPage, $page);
+ }
+
+ /**
+ * Get the results of a query for a given page.
*
+ * @param int $page
+ * @param int $perPage
+ * @param string $orderBy
+ * @param string $orderByDir
+ * @return Collection|array
+ */
+ public function forPage($page = 1, $perPage = 100, $orderBy = 'cn', $orderByDir = 'asc')
+ {
+ if (! $this->hasOrderBy()) {
+ $this->orderBy($orderBy, $orderByDir);
+ }
+
+ $this->addControl(LDAP_CONTROL_VLVREQUEST, true, [
+ 'before' => 0,
+ 'after' => $perPage - 1,
+ 'offset' => ($page * $perPage) - $perPage + 1,
+ 'count' => 0,
+ ]);
+
+ return $this->get();
+ }
+
+ /**
+ * Processes and converts the given LDAP results into models.
+ *
+ * @param array $results
* @return array
*/
protected function process(array $results)
@@ -595,8 +632,7 @@ class Builder
/**
* Flattens LDAP paged results into a single array.
*
- * @param array $pages
- *
+ * @param array $pages
* @return array
*/
protected function flattenPages(array $pages)
@@ -615,9 +651,8 @@ class Builder
/**
* Get the cached response or execute and cache the callback value.
*
- * @param string $query
- * @param Closure $callback
- *
+ * @param string $query
+ * @param Closure $callback
* @return mixed
*/
protected function getCachedResponse($query, Closure $callback)
@@ -638,8 +673,7 @@ class Builder
/**
* Runs the query operation with the given filter.
*
- * @param string $filter
- *
+ * @param string $filter
* @return resource
*/
public function run($filter)
@@ -668,8 +702,7 @@ class Builder
/**
* Parses the given LDAP resource by retrieving its entries.
*
- * @param resource $resource
- *
+ * @param resource $resource
* @return array
*/
public function parse($resource)
@@ -708,13 +741,14 @@ class Builder
/**
* Returns the cache key.
*
- * @param string $query
- *
+ * @param string $query
* @return string
*/
protected function getCacheKey($query)
{
- $host = $this->connection->getLdapConnection()->getHost();
+ $host = $this->connection->run(function (LdapInterface $ldap) {
+ return $ldap->getHost();
+ });
$key = $host
.$this->type
@@ -730,8 +764,7 @@ class Builder
/**
* Returns the first entry in a search result.
*
- * @param array|string $columns
- *
+ * @param array|string $columns
* @return Model|null
*/
public function first($columns = ['*'])
@@ -746,8 +779,7 @@ class Builder
*
* If no entry is found, an exception is thrown.
*
- * @param array|string $columns
- *
+ * @param array|string $columns
* @return Model|array
*
* @throws ObjectNotFoundException
@@ -764,8 +796,7 @@ class Builder
/**
* Return the first entry in a result, or execute the callback.
*
- * @param Closure $callback
- *
+ * @param Closure $callback
* @return Model|mixed
*/
public function firstOr(Closure $callback)
@@ -776,8 +807,7 @@ class Builder
/**
* Execute the query and get the first result if it's the sole matching record.
*
- * @param array|string $columns
- *
+ * @param array|string $columns
* @return Model|array
*
* @throws ObjectsNotFoundException
@@ -821,8 +851,7 @@ class Builder
/**
* Execute the given callback if no rows exist for the current query.
*
- * @param Closure $callback
- *
+ * @param Closure $callback
* @return bool|mixed
*/
public function existsOr(Closure $callback)
@@ -833,8 +862,8 @@ class Builder
/**
* Throws a not found exception.
*
- * @param string $query
- * @param string $dn
+ * @param string $query
+ * @param string $dn
*
* @throws ObjectNotFoundException
*/
@@ -846,10 +875,9 @@ class Builder
/**
* Finds a record by the specified attribute and value.
*
- * @param string $attribute
- * @param string $value
- * @param array|string $columns
- *
+ * @param string $attribute
+ * @param string $value
+ * @param array|string $columns
* @return Model|static|null
*/
public function findBy($attribute, $value, $columns = ['*'])
@@ -866,10 +894,9 @@ class Builder
*
* If no record is found an exception is thrown.
*
- * @param string $attribute
- * @param string $value
- * @param array|string $columns
- *
+ * @param string $attribute
+ * @param string $value
+ * @param array|string $columns
* @return Model
*
* @throws ObjectNotFoundException
@@ -882,9 +909,8 @@ class Builder
/**
* Find many records by distinguished name.
*
- * @param array $dns
- * @param array $columns
- *
+ * @param string|array $dns
+ * @param array $columns
* @return array|Collection
*/
public function findMany($dns, $columns = ['*'])
@@ -895,7 +921,7 @@ class Builder
$objects = [];
- foreach ($dns as $dn) {
+ foreach ((array) $dns as $dn) {
if (! is_null($object = $this->find($dn, $columns))) {
$objects[] = $object;
}
@@ -907,10 +933,9 @@ class Builder
/**
* Finds many records by the specified attribute.
*
- * @param string $attribute
- * @param array $values
- * @param array $columns
- *
+ * @param string $attribute
+ * @param array $values
+ * @param array $columns
* @return Collection
*/
public function findManyBy($attribute, array $values = [], $columns = ['*'])
@@ -927,9 +952,8 @@ class Builder
/**
* Finds a record by its distinguished name.
*
- * @param string|array $dn
- * @param array|string $columns
- *
+ * @param string|array $dn
+ * @param array|string $columns
* @return Model|static|array|Collection|null
*/
public function find($dn, $columns = ['*'])
@@ -950,9 +974,8 @@ class Builder
*
* Fails upon no records returned.
*
- * @param string $dn
- * @param array|string $columns
- *
+ * @param string $dn
+ * @param array|string $columns
* @return Model|static
*
* @throws ObjectNotFoundException
@@ -968,8 +991,7 @@ class Builder
/**
* Adds the inserted fields to query on the current LDAP connection.
*
- * @param array|string $columns
- *
+ * @param array|string $columns
* @return $this
*/
public function select($columns = ['*'])
@@ -986,8 +1008,7 @@ class Builder
/**
* Add a new select column to the query.
*
- * @param array|mixed $column
- *
+ * @param array|mixed $column
* @return $this
*/
public function addSelect($column)
@@ -1002,9 +1023,8 @@ class Builder
/**
* Add an order by control to the query.
*
- * @param string $attribute
- * @param string $direction
- *
+ * @param string $attribute
+ * @param string $direction
* @return $this
*/
public function orderBy($attribute, $direction = 'asc')
@@ -1017,8 +1037,7 @@ class Builder
/**
* Add an order by descending control to the query.
*
- * @param string $attribute
- *
+ * @param string $attribute
* @return $this
*/
public function orderByDesc($attribute)
@@ -1027,10 +1046,19 @@ class Builder
}
/**
- * Adds a raw filter to the current query.
+ * Determine if the query has a sotr request control header.
*
- * @param array|string $filters
+ * @return bool
+ */
+ public function hasOrderBy()
+ {
+ return $this->hasControl(LDAP_CONTROL_SORTREQUEST);
+ }
+
+ /**
+ * Adds a raw filter to the current query.
*
+ * @param array|string $filters
* @return $this
*/
public function rawFilter($filters = [])
@@ -1047,8 +1075,7 @@ class Builder
/**
* Adds a nested 'and' filter to the current query.
*
- * @param Closure $closure
- *
+ * @param Closure $closure
* @return $this
*/
public function andFilter(Closure $closure)
@@ -1063,8 +1090,7 @@ class Builder
/**
* Adds a nested 'or' filter to the current query.
*
- * @param Closure $closure
- *
+ * @param Closure $closure
* @return $this
*/
public function orFilter(Closure $closure)
@@ -1079,8 +1105,7 @@ class Builder
/**
* Adds a nested 'not' filter to the current query.
*
- * @param Closure $closure
- *
+ * @param Closure $closure
* @return $this
*/
public function notFilter(Closure $closure)
@@ -1095,12 +1120,11 @@ class Builder
/**
* Adds a where clause to the current query.
*
- * @param string|array $field
- * @param string $operator
- * @param string $value
- * @param string $boolean
- * @param bool $raw
- *
+ * @param string|array $field
+ * @param string $operator
+ * @param string $value
+ * @param string $boolean
+ * @param bool $raw
* @return $this
*
* @throws InvalidArgumentException
@@ -1138,10 +1162,9 @@ class Builder
/**
* Prepare the value for being queried.
*
- * @param string $field
- * @param string $value
- * @param bool $raw
- *
+ * @param string $field
+ * @param string $value
+ * @param bool $raw
* @return string
*/
protected function prepareWhereValue($field, $value, $raw = false)
@@ -1154,10 +1177,9 @@ class Builder
*
* Values given to this method are not escaped.
*
- * @param string|array $field
- * @param string $operator
- * @param string $value
- *
+ * @param string|array $field
+ * @param string $operator
+ * @param string $value
* @return $this
*/
public function whereRaw($field, $operator = null, $value = null)
@@ -1168,9 +1190,8 @@ class Builder
/**
* Adds a 'where equals' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereEquals($field, $value)
@@ -1181,9 +1202,8 @@ class Builder
/**
* Adds a 'where not equals' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereNotEquals($field, $value)
@@ -1194,9 +1214,8 @@ class Builder
/**
* Adds a 'where approximately equals' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereApproximatelyEquals($field, $value)
@@ -1207,8 +1226,7 @@ class Builder
/**
* Adds a 'where has' clause to the current query.
*
- * @param string $field
- *
+ * @param string $field
* @return $this
*/
public function whereHas($field)
@@ -1219,8 +1237,7 @@ class Builder
/**
* Adds a 'where not has' clause to the current query.
*
- * @param string $field
- *
+ * @param string $field
* @return $this
*/
public function whereNotHas($field)
@@ -1231,9 +1248,8 @@ class Builder
/**
* Adds a 'where contains' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereContains($field, $value)
@@ -1244,9 +1260,8 @@ class Builder
/**
* Adds a 'where contains' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereNotContains($field, $value)
@@ -1257,9 +1272,8 @@ class Builder
/**
* Query for entries that match any of the values provided for the given field.
*
- * @param string $field
- * @param array $values
- *
+ * @param string $field
+ * @param array $values
* @return $this
*/
public function whereIn($field, array $values)
@@ -1274,9 +1288,8 @@ class Builder
/**
* Adds a 'between' clause to the current query.
*
- * @param string $field
- * @param array $values
- *
+ * @param string $field
+ * @param array $values
* @return $this
*/
public function whereBetween($field, array $values)
@@ -1290,9 +1303,8 @@ class Builder
/**
* Adds a 'where starts with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereStartsWith($field, $value)
@@ -1303,9 +1315,8 @@ class Builder
/**
* Adds a 'where *not* starts with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereNotStartsWith($field, $value)
@@ -1316,9 +1327,8 @@ class Builder
/**
* Adds a 'where ends with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereEndsWith($field, $value)
@@ -1329,9 +1339,8 @@ class Builder
/**
* Adds a 'where *not* ends with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function whereNotEndsWith($field, $value)
@@ -1362,10 +1371,9 @@ class Builder
/**
* Add a server control to the query.
*
- * @param string $oid
- * @param bool $isCritical
- * @param mixed $value
- *
+ * @param string $oid
+ * @param bool $isCritical
+ * @param mixed $value
* @return $this
*/
public function addControl($oid, $isCritical = false, $value = null)
@@ -1378,8 +1386,7 @@ class Builder
/**
* Determine if the server control exists on the query.
*
- * @param string $oid
- *
+ * @param string $oid
* @return bool
*/
public function hasControl($oid)
@@ -1390,10 +1397,9 @@ class Builder
/**
* Adds an 'or where' clause to the current query.
*
- * @param array|string $field
- * @param string|null $operator
- * @param string|null $value
- *
+ * @param array|string $field
+ * @param string|null $operator
+ * @param string|null $value
* @return $this
*/
public function orWhere($field, $operator = null, $value = null)
@@ -1406,10 +1412,9 @@ class Builder
*
* Values given to this method are not escaped.
*
- * @param string $field
- * @param string $operator
- * @param string $value
- *
+ * @param string $field
+ * @param string $operator
+ * @param string $value
* @return $this
*/
public function orWhereRaw($field, $operator = null, $value = null)
@@ -1420,8 +1425,7 @@ class Builder
/**
* Adds an 'or where has' clause to the current query.
*
- * @param string $field
- *
+ * @param string $field
* @return $this
*/
public function orWhereHas($field)
@@ -1432,8 +1436,7 @@ class Builder
/**
* Adds a 'where not has' clause to the current query.
*
- * @param string $field
- *
+ * @param string $field
* @return $this
*/
public function orWhereNotHas($field)
@@ -1444,9 +1447,8 @@ class Builder
/**
* Adds an 'or where equals' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereEquals($field, $value)
@@ -1457,9 +1459,8 @@ class Builder
/**
* Adds an 'or where not equals' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereNotEquals($field, $value)
@@ -1470,9 +1471,8 @@ class Builder
/**
* Adds a 'or where approximately equals' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereApproximatelyEquals($field, $value)
@@ -1483,9 +1483,8 @@ class Builder
/**
* Adds an 'or where contains' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereContains($field, $value)
@@ -1496,9 +1495,8 @@ class Builder
/**
* Adds an 'or where *not* contains' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereNotContains($field, $value)
@@ -1509,9 +1507,8 @@ class Builder
/**
* Adds an 'or where starts with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereStartsWith($field, $value)
@@ -1522,9 +1519,8 @@ class Builder
/**
* Adds an 'or where *not* starts with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereNotStartsWith($field, $value)
@@ -1535,9 +1531,8 @@ class Builder
/**
* Adds an 'or where ends with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereEndsWith($field, $value)
@@ -1548,9 +1543,8 @@ class Builder
/**
* Adds an 'or where *not* ends with' clause to the current query.
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return $this
*/
public function orWhereNotEndsWith($field, $value)
@@ -1561,9 +1555,8 @@ class Builder
/**
* Adds a filter binding onto the current query.
*
- * @param string $type The type of filter to add.
- * @param array $bindings The bindings of the filter.
- *
+ * @param string $type The type of filter to add.
+ * @param array $bindings The bindings of the filter.
* @return $this
*
* @throws InvalidArgumentException
@@ -1591,8 +1584,7 @@ class Builder
/**
* Extract any missing required binding keys.
*
- * @param array $bindings
- *
+ * @param array $bindings
* @return array
*/
protected function missingBindingKeys($bindings)
@@ -1704,8 +1696,7 @@ class Builder
/**
* Whether to mark the current query as nested.
*
- * @param bool $nested
- *
+ * @param bool $nested
* @return $this
*/
public function nested($nested = true)
@@ -1720,9 +1711,8 @@ class Builder
*
* If flushing is enabled, the query cache will be flushed and then re-cached.
*
- * @param DateTimeInterface $until When to expire the query cache.
- * @param bool $flush Whether to force-flush the query cache.
- *
+ * @param DateTimeInterface $until When to expire the query cache.
+ * @param bool $flush Whether to force-flush the query cache.
* @return $this
*/
public function cache(DateTimeInterface $until = null, $flush = false)
@@ -1757,9 +1747,8 @@ class Builder
/**
* Insert an entry into the directory.
*
- * @param string $dn
- * @param array $attributes
- *
+ * @param string $dn
+ * @param array $attributes
* @return bool
*
* @throws LdapRecordException
@@ -1784,9 +1773,8 @@ class Builder
/**
* Create attributes on the entry in the directory.
*
- * @param string $dn
- * @param array $attributes
- *
+ * @param string $dn
+ * @param array $attributes
* @return bool
*/
public function insertAttributes($dn, array $attributes)
@@ -1799,9 +1787,8 @@ class Builder
/**
* Update the entry with the given modifications.
*
- * @param string $dn
- * @param array $modifications
- *
+ * @param string $dn
+ * @param array $modifications
* @return bool
*/
public function update($dn, array $modifications)
@@ -1814,9 +1801,8 @@ class Builder
/**
* Update an entries attribute in the directory.
*
- * @param string $dn
- * @param array $attributes
- *
+ * @param string $dn
+ * @param array $attributes
* @return bool
*/
public function updateAttributes($dn, array $attributes)
@@ -1829,8 +1815,7 @@ class Builder
/**
* Delete an entry from the directory.
*
- * @param string $dn
- *
+ * @param string $dn
* @return bool
*/
public function delete($dn)
@@ -1843,9 +1828,8 @@ class Builder
/**
* Delete attributes on the entry in the directory.
*
- * @param string $dn
- * @param array $attributes
- *
+ * @param string $dn
+ * @param array $attributes
* @return bool
*/
public function deleteAttributes($dn, array $attributes)
@@ -1858,11 +1842,10 @@ class Builder
/**
* Rename an entry in the directory.
*
- * @param string $dn
- * @param string $rdn
- * @param string $newParentDn
- * @param bool $deleteOldRdn
- *
+ * @param string $dn
+ * @param string $rdn
+ * @param string $newParentDn
+ * @param bool $deleteOldRdn
* @return bool
*/
public function rename($dn, $rdn, $newParentDn, $deleteOldRdn = true)
@@ -1873,11 +1856,20 @@ class Builder
}
/**
- * Handle dynamic method calls on the query builder.
+ * Clone the query.
*
- * @param string $method
- * @param array $parameters
+ * @return static
+ */
+ public function clone()
+ {
+ return clone $this;
+ }
+
+ /**
+ * Handle dynamic method calls on the query builder.
*
+ * @param string $method
+ * @param array $parameters
* @return mixed
*
* @throws BadMethodCallException
@@ -1901,9 +1893,8 @@ class Builder
/**
* Handles dynamic "where" clauses to the query.
*
- * @param string $method
- * @param array $parameters
- *
+ * @param string $method
+ * @param array $parameters
* @return $this
*/
public function dynamicWhere($method, $parameters)
@@ -1943,10 +1934,9 @@ class Builder
/**
* Adds an array of wheres to the current query.
*
- * @param array $wheres
- * @param string $boolean
- * @param bool $raw
- *
+ * @param array $wheres
+ * @param string $boolean
+ * @param bool $raw
* @return $this
*/
protected function addArrayOfWheres($wheres, $boolean, $raw)
@@ -1975,11 +1965,10 @@ class Builder
/**
* Add a single dynamic where clause statement to the query.
*
- * @param string $segment
- * @param string $connector
- * @param array $parameters
- * @param int $index
- *
+ * @param string $segment
+ * @param string $connector
+ * @param array $parameters
+ * @param int $index
* @return void
*/
protected function addDynamic($segment, $connector, $parameters, $index)
@@ -1996,10 +1985,9 @@ class Builder
/**
* Logs the given executed query information by firing its query event.
*
- * @param Builder $query
- * @param string $type
- * @param null|float $time
- *
+ * @param Builder $query
+ * @param string $type
+ * @param null|float $time
* @return void
*/
protected function logQuery($query, $type, $time = null)
@@ -2030,8 +2018,7 @@ class Builder
/**
* Fires the given query event.
*
- * @param QueryExecuted $event
- *
+ * @param QueryExecuted $event
* @return void
*/
protected function fireQueryEvent(QueryExecuted $event)
@@ -2042,8 +2029,7 @@ class Builder
/**
* Get the elapsed time since a given starting point.
*
- * @param int $start
- *
+ * @param int $start
* @return float
*/
protected function getElapsedTime($start)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Cache.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Cache.php
index dfbf8cd2..d6057bfb 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Cache.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Cache.php
@@ -21,7 +21,7 @@ class Cache
/**
* Constructor.
*
- * @param CacheInterface $store
+ * @param CacheInterface $store
*/
public function __construct(CacheInterface $store)
{
@@ -31,8 +31,7 @@ class Cache
/**
* Get an item from the cache.
*
- * @param string $key
- *
+ * @param string $key
* @return mixed
*/
public function get($key)
@@ -43,10 +42,9 @@ class Cache
/**
* Store an item in the cache.
*
- * @param string $key
- * @param mixed $value
- * @param DateTimeInterface|DateInterval|int|null $ttl
- *
+ * @param string $key
+ * @param mixed $value
+ * @param DateTimeInterface|DateInterval|int|null $ttl
* @return bool
*/
public function put($key, $value, $ttl = null)
@@ -63,10 +61,9 @@ class Cache
/**
* Get an item from the cache, or execute the given Closure and store the result.
*
- * @param string $key
- * @param DateTimeInterface|DateInterval|int|null $ttl
- * @param Closure $callback
- *
+ * @param string $key
+ * @param DateTimeInterface|DateInterval|int|null $ttl
+ * @param Closure $callback
* @return mixed
*/
public function remember($key, $ttl, Closure $callback)
@@ -85,8 +82,7 @@ class Cache
/**
* Delete an item from the cache.
*
- * @param string $key
- *
+ * @param string $key
* @return bool
*/
public function delete($key)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php
index 4f17ea2a..8ed8f835 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Events/QueryExecuted.php
@@ -23,8 +23,8 @@ class QueryExecuted
/**
* Constructor.
*
- * @param Builder $query
- * @param null|float $time
+ * @param Builder $query
+ * @param null|float $time
*/
public function __construct(Builder $query, $time = null)
{
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ConditionNode.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ConditionNode.php
new file mode 100644
index 00000000..6203360c
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ConditionNode.php
@@ -0,0 +1,100 @@
+<?php
+
+namespace LdapRecord\Query\Filter;
+
+use LdapRecord\Support\Str;
+
+class ConditionNode extends Node
+{
+ /**
+ * The condition's attribute.
+ *
+ * @var string
+ */
+ protected $attribute;
+
+ /**
+ * The condition's operator.
+ *
+ * @var string
+ */
+ protected $operator;
+
+ /**
+ * The condition's value.
+ *
+ * @var string
+ */
+ protected $value;
+
+ /**
+ * The available condition operators.
+ *
+ * @var array
+ */
+ protected $operators = ['>=', '<=', '~=', '='];
+
+ /**
+ * Constructor.
+ *
+ * @param string $filter
+ */
+ public function __construct($filter)
+ {
+ $this->raw = $filter;
+
+ [$this->attribute, $this->value] = $this->extractComponents($filter);
+ }
+
+ /**
+ * Get the condition's attribute.
+ *
+ * @return string
+ */
+ public function getAttribute()
+ {
+ return $this->attribute;
+ }
+
+ /**
+ * Get the condition's operator.
+ *
+ * @return string
+ */
+ public function getOperator()
+ {
+ return $this->operator;
+ }
+
+ /**
+ * Get the condition's value.
+ *
+ * @return string
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Extract the condition components from the filter.
+ *
+ * @param string $filter
+ * @return array
+ */
+ protected function extractComponents($filter)
+ {
+ $components = Str::whenContains(
+ $filter,
+ $this->operators,
+ function ($operator, $filter) {
+ return explode($this->operator = $operator, $filter, 2);
+ },
+ function ($filter) {
+ throw new ParserException("Invalid query condition. No operator found in [$filter]");
+ },
+ );
+
+ return $components;
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/GroupNode.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/GroupNode.php
new file mode 100644
index 00000000..1a3596f3
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/GroupNode.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace LdapRecord\Query\Filter;
+
+class GroupNode extends Node
+{
+ /**
+ * The group's operator.
+ *
+ * @var string
+ */
+ protected $operator;
+
+ /**
+ * The group's sub-nodes.
+ *
+ * @var Node[]
+ */
+ protected $nodes = [];
+
+ /**
+ * Constructor.
+ *
+ * @param string $filter
+ */
+ public function __construct($filter)
+ {
+ $this->raw = $filter;
+
+ $this->operator = substr($filter, 0, 1);
+
+ $this->nodes = Parser::parse($filter);
+ }
+
+ /**
+ * Get the group's operator.
+ *
+ * @return string
+ */
+ public function getOperator()
+ {
+ return $this->operator;
+ }
+
+ /**
+ * Get the group's sub-nodes.
+ *
+ * @return Node[]
+ */
+ public function getNodes()
+ {
+ return $this->nodes;
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Node.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Node.php
new file mode 100644
index 00000000..faf88d41
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Node.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace LdapRecord\Query\Filter;
+
+abstract class Node
+{
+ /**
+ * The raw value of the node.
+ *
+ * @var string
+ */
+ protected $raw;
+
+ /**
+ * Create a new filter node.
+ *
+ * @param string $filter
+ */
+ abstract public function __construct($filter);
+
+ /**
+ * Get the raw value of the node.
+ *
+ * @return string
+ */
+ public function getRaw()
+ {
+ return $this->raw;
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Parser.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Parser.php
new file mode 100644
index 00000000..7717ac52
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/Parser.php
@@ -0,0 +1,162 @@
+<?php
+
+namespace LdapRecord\Query\Filter;
+
+use LdapRecord\Support\Arr;
+use LdapRecord\Support\Str;
+
+class Parser
+{
+ /**
+ * Parse an LDAP filter into nodes.
+ *
+ * @param string $string
+ * @return (ConditionNode|GroupNode)[]
+ *
+ * @throws ParserException
+ */
+ public static function parse($string)
+ {
+ [$open, $close] = static::countParenthesis($string);
+
+ if ($open !== $close) {
+ $errors = [-1 => '"("', 1 => '")"'];
+
+ throw new ParserException(
+ sprintf('Unclosed filter group. Missing %s parenthesis', $errors[$open <=> $close])
+ );
+ }
+
+ return static::buildNodes(
+ array_map('trim', static::match($string))
+ );
+ }
+
+ /**
+ * Perform a match for all filters in the string.
+ *
+ * @param string $string
+ * @return array
+ */
+ protected static function match($string)
+ {
+ preg_match_all("/\((((?>[^()]+)|(?R))*)\)/", trim($string), $matches);
+
+ return $matches[1] ?? [];
+ }
+
+ /**
+ * Assemble the parsed nodes into a single filter.
+ *
+ * @param Node|Node[] $nodes
+ * @return string
+ */
+ public static function assemble($nodes = [])
+ {
+ return array_reduce(Arr::wrap($nodes), function ($carry, Node $node) {
+ return $carry .= static::compileNode($node);
+ });
+ }
+
+ /**
+ * Assemble the node into its string based format.
+ *
+ * @param GroupNode|ConditionNode $node
+ * @return string
+ */
+ protected static function compileNode(Node $node)
+ {
+ switch (true) {
+ case $node instanceof GroupNode:
+ return static::wrap($node->getOperator().static::assemble($node->getNodes()));
+ case $node instanceof ConditionNode:
+ return static::wrap($node->getAttribute().$node->getOperator().$node->getValue());
+ default:
+ return $node->getRaw();
+ }
+ }
+
+ /**
+ * Build an array of nodes from the given filters.
+ *
+ * @param string[] $filters
+ * @return (ConditionNode|GroupNode)[]
+ *
+ * @throws ParserException
+ */
+ protected static function buildNodes(array $filters = [])
+ {
+ return array_map(function ($filter) {
+ if (static::isWrapped($filter)) {
+ $filter = static::unwrap($filter);
+ }
+
+ if (static::isGroup($filter) && ! Str::endsWith($filter, ')')) {
+ throw new ParserException(sprintf('Unclosed filter group [%s]', Str::afterLast($filter, ')')));
+ }
+
+ return static::isGroup($filter)
+ ? new GroupNode($filter)
+ : new ConditionNode($filter);
+ }, $filters);
+ }
+
+ /**
+ * Count the open and close parenthesis of the sting.
+ *
+ * @param string $string
+ * @return array
+ */
+ protected static function countParenthesis($string)
+ {
+ return [Str::substrCount($string, '('), Str::substrCount($string, ')')];
+ }
+
+ /**
+ * Wrap the value in parentheses.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected static function wrap($value)
+ {
+ return "($value)";
+ }
+
+ /**
+ * Recursively unwrwap the value from its parentheses.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected static function unwrap($value)
+ {
+ $nodes = static::parse($value);
+
+ $unwrapped = Arr::first($nodes);
+
+ return $unwrapped instanceof Node ? $unwrapped->getRaw() : $value;
+ }
+
+ /**
+ * Determine if the filter is wrapped.
+ *
+ * @param string $filter
+ * @return bool
+ */
+ protected static function isWrapped($filter)
+ {
+ return Str::startsWith($filter, '(') && Str::endsWith($filter, ')');
+ }
+
+ /**
+ * Determine if the filter is a group.
+ *
+ * @param string $filter
+ * @return bool
+ */
+ protected static function isGroup($filter)
+ {
+ return Str::startsWith($filter, ['&', '|', '!']);
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ParserException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ParserException.php
new file mode 100644
index 00000000..68a4ca17
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Filter/ParserException.php
@@ -0,0 +1,9 @@
+<?php
+
+namespace LdapRecord\Query\Filter;
+
+use LdapRecord\LdapRecordException;
+
+class ParserException extends LdapRecordException
+{
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php
index 35a6c484..84c4b8d0 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Grammar.php
@@ -50,10 +50,9 @@ class Grammar
*
* Produces: (query)
*
- * @param string $query
- * @param string $prefix
- * @param string $suffix
- *
+ * @param string $query
+ * @param string $prefix
+ * @param string $suffix
* @return string
*/
public function wrap($query, $prefix = '(', $suffix = ')')
@@ -64,8 +63,7 @@ class Grammar
/**
* Compiles the Builder instance into an LDAP query string.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return string
*/
public function compile(Builder $query)
@@ -91,8 +89,7 @@ class Grammar
/**
* Determine if the query must be wrapped in an encapsulating statement.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return bool
*/
protected function queryMustBeWrapped(Builder $query)
@@ -103,8 +100,7 @@ class Grammar
/**
* Assembles all of the "raw" filters on the query.
*
- * @param Builder $builder
- *
+ * @param Builder $builder
* @return string
*/
protected function compileRaws(Builder $builder)
@@ -115,9 +111,8 @@ class Grammar
/**
* Assembles all where clauses in the current wheres property.
*
- * @param Builder $builder
- * @param string $type
- *
+ * @param Builder $builder
+ * @param string $type
* @return string
*/
protected function compileWheres(Builder $builder, $type = 'and')
@@ -134,8 +129,7 @@ class Grammar
/**
* Assembles all or where clauses in the current orWheres property.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return string
*/
protected function compileOrWheres(Builder $query)
@@ -161,8 +155,7 @@ class Grammar
/**
* Determine if the query can be wrapped in a single or statement.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return bool
*/
protected function queryCanBeWrappedInSingleOrStatement(Builder $query)
@@ -175,8 +168,7 @@ class Grammar
/**
* Concatenates filters into a single string.
*
- * @param array $bindings
- *
+ * @param array $bindings
* @return string
*/
public function concatenate(array $bindings = [])
@@ -190,8 +182,7 @@ class Grammar
/**
* Determine if the binding value is not empty.
*
- * @param string $value
- *
+ * @param string $value
* @return bool
*/
protected function bindingValueIsNotEmpty($value)
@@ -202,8 +193,7 @@ class Grammar
/**
* Determine if the query is using multiple filters.
*
- * @param Builder $query
- *
+ * @param Builder $query
* @return bool
*/
protected function hasMultipleFilters(Builder $query)
@@ -214,11 +204,10 @@ class Grammar
/**
* Determine if the query contains the given filter statement type.
*
- * @param Builder $query
- * @param string|array $type
- * @param string $operator
- * @param int $count
- *
+ * @param Builder $query
+ * @param string|array $type
+ * @param string $operator
+ * @param int $count
* @return bool
*/
protected function has(Builder $query, $type, $operator = '>=', $count = 1)
@@ -250,9 +239,8 @@ class Grammar
*
* Produces: (field=value)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileEquals($field, $value)
@@ -265,9 +253,8 @@ class Grammar
*
* Produces: (!(field=value))
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileDoesNotEqual($field, $value)
@@ -282,9 +269,8 @@ class Grammar
*
* Produces: (!(field=value))
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileDoesNotEqualAlias($field, $value)
@@ -297,9 +283,8 @@ class Grammar
*
* Produces: (field>=value)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileGreaterThanOrEquals($field, $value)
@@ -312,9 +297,8 @@ class Grammar
*
* Produces: (field<=value)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileLessThanOrEquals($field, $value)
@@ -327,9 +311,8 @@ class Grammar
*
* Produces: (field~=value)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileApproximatelyEquals($field, $value)
@@ -342,9 +325,8 @@ class Grammar
*
* Produces: (field=value*)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileStartsWith($field, $value)
@@ -357,9 +339,8 @@ class Grammar
*
* Produces: (!(field=*value))
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileNotStartsWith($field, $value)
@@ -374,9 +355,8 @@ class Grammar
*
* Produces: (field=*value)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileEndsWith($field, $value)
@@ -389,9 +369,8 @@ class Grammar
*
* Produces: (!(field=value*))
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileNotEndsWith($field, $value)
@@ -404,9 +383,8 @@ class Grammar
*
* Produces: (field=*value*)
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileContains($field, $value)
@@ -419,9 +397,8 @@ class Grammar
*
* Produces: (!(field=*value*))
*
- * @param string $field
- * @param string $value
- *
+ * @param string $field
+ * @param string $value
* @return string
*/
public function compileNotContains($field, $value)
@@ -436,8 +413,7 @@ class Grammar
*
* Produces: (field=*)
*
- * @param string $field
- *
+ * @param string $field
* @return string
*/
public function compileHas($field)
@@ -450,8 +426,7 @@ class Grammar
*
* Produces: (!(field=*))
*
- * @param string $field
- *
+ * @param string $field
* @return string
*/
public function compileNotHas($field)
@@ -466,8 +441,7 @@ class Grammar
*
* Produces: (&query)
*
- * @param string $query
- *
+ * @param string $query
* @return string
*/
public function compileAnd($query)
@@ -480,8 +454,7 @@ class Grammar
*
* Produces: (|query)
*
- * @param string $query
- *
+ * @param string $query
* @return string
*/
public function compileOr($query)
@@ -492,8 +465,7 @@ class Grammar
/**
* Wraps the inserted query inside an NOT operator.
*
- * @param string $query
- *
+ * @param string $query
* @return string
*/
public function compileNot($query)
@@ -504,8 +476,7 @@ class Grammar
/**
* Assembles a single where query.
*
- * @param array $where
- *
+ * @param array $where
* @return string
*
* @throws UnexpectedValueException
@@ -520,8 +491,7 @@ class Grammar
/**
* Make the compile method name for the operator.
*
- * @param string $operator
- *
+ * @param string $operator
* @return string
*
* @throws UnexpectedValueException
@@ -538,8 +508,7 @@ class Grammar
/**
* Determine if the operator exists.
*
- * @param string $operator
- *
+ * @param string $operator
* @return bool
*/
protected function operatorExists($operator)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/InteractsWithTime.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/InteractsWithTime.php
index 1562ec0a..e8024c03 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/InteractsWithTime.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/InteractsWithTime.php
@@ -16,8 +16,7 @@ trait InteractsWithTime
/**
* Get the number of seconds until the given DateTime.
*
- * @param DateTimeInterface|DateInterval|int $delay
- *
+ * @param DateTimeInterface|DateInterval|int $delay
* @return int
*/
protected function secondsUntil($delay)
@@ -32,8 +31,7 @@ trait InteractsWithTime
/**
* Get the "available at" UNIX timestamp.
*
- * @param DateTimeInterface|DateInterval|int $delay
- *
+ * @param DateTimeInterface|DateInterval|int $delay
* @return int
*/
protected function availableAt($delay = 0)
@@ -48,8 +46,7 @@ trait InteractsWithTime
/**
* If the given value is an interval, convert it to a DateTime instance.
*
- * @param DateTimeInterface|DateInterval|int $delay
- *
+ * @param DateTimeInterface|DateInterval|int $delay
* @return DateTimeInterface|int
*/
protected function parseDateInterval($delay)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php
index c3911d80..3b0e96f7 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/ActiveDirectoryBuilder.php
@@ -12,9 +12,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Finds a record by its Object SID.
*
- * @param string $sid
- * @param array|string $columns
- *
+ * @param string $sid
+ * @param array|string $columns
* @return \LdapRecord\Models\ActiveDirectory\Entry|static|null
*/
public function findBySid($sid, $columns = [])
@@ -31,9 +30,8 @@ class ActiveDirectoryBuilder extends Builder
*
* Fails upon no records returned.
*
- * @param string $sid
- * @param array|string $columns
- *
+ * @param string $sid
+ * @param array|string $columns
* @return \LdapRecord\Models\ActiveDirectory\Entry|static
*
* @throws ModelNotFoundException
@@ -70,9 +68,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds a 'where member' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function whereMember($dn, $nested = false)
@@ -85,9 +82,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds an 'or where member' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function orWhereMember($dn, $nested = false)
@@ -100,9 +96,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds a 'where member of' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function whereMemberOf($dn, $nested = false)
@@ -115,9 +110,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds a 'where not member of' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function whereNotMemberof($dn, $nested = false)
@@ -130,9 +124,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds an 'or where member of' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function orWhereMemberOf($dn, $nested = false)
@@ -145,9 +138,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds a 'or where not member of' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function orWhereNotMemberof($dn, $nested = false)
@@ -160,9 +152,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds a 'where manager' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function whereManager($dn, $nested = false)
@@ -175,9 +166,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds a 'where not manager' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function whereNotManager($dn, $nested = false)
@@ -190,9 +180,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds an 'or where manager' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function orWhereManager($dn, $nested = false)
@@ -205,9 +194,8 @@ class ActiveDirectoryBuilder extends Builder
/**
* Adds an 'or where not manager' filter to the current query.
*
- * @param string $dn
- * @param bool $nested
- *
+ * @param string $dn
+ * @param bool $nested
* @return $this
*/
public function orWhereNotManager($dn, $nested = false)
@@ -220,10 +208,9 @@ class ActiveDirectoryBuilder extends Builder
/**
* Execute the callback with a nested match attribute.
*
- * @param Closure $callback
- * @param string $attribute
- * @param bool $nested
- *
+ * @param Closure $callback
+ * @param string $attribute
+ * @param bool $nested
* @return $this
*/
protected function nestedMatchQuery(Closure $callback, $attribute, $nested = false)
@@ -236,8 +223,7 @@ class ActiveDirectoryBuilder extends Builder
/**
* Make a "nested match" filter attribute for querying descendants.
*
- * @param string $attribute
- *
+ * @param string $attribute
* @return string
*/
protected function makeNestedMatchAttribute($attribute)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php
index 234dd0ad..a6886ea9 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Model/Builder.php
@@ -44,9 +44,8 @@ class Builder extends BaseBuilder
/**
* Dynamically handle calls into the query instance.
*
- * @param string $method
- * @param array $parameters
- *
+ * @param string $method
+ * @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
@@ -61,9 +60,8 @@ class Builder extends BaseBuilder
/**
* Apply the given scope on the current builder instance.
*
- * @param callable $scope
- * @param array $parameters
- *
+ * @param callable $scope
+ * @param array $parameters
* @return mixed
*/
protected function callScope(callable $scope, $parameters = [])
@@ -91,8 +89,7 @@ class Builder extends BaseBuilder
/**
* Set the model instance for the model being queried.
*
- * @param Model $model
- *
+ * @param Model $model
* @return $this
*/
public function setModel(Model $model)
@@ -115,8 +112,7 @@ class Builder extends BaseBuilder
/**
* Get a new model query builder instance.
*
- * @param string|null $baseDn
- *
+ * @param string|null $baseDn
* @return static
*/
public function newInstance($baseDn = null)
@@ -127,9 +123,8 @@ class Builder extends BaseBuilder
/**
* Finds a model by its distinguished name.
*
- * @param array|string $dn
- * @param array|string|string[] $columns
- *
+ * @param array|string $dn
+ * @param array|string|string[] $columns
* @return Model|\LdapRecord\Query\Collection|static|null
*/
public function find($dn, $columns = ['*'])
@@ -142,9 +137,8 @@ class Builder extends BaseBuilder
/**
* Finds a record using ambiguous name resolution.
*
- * @param string|array $value
- * @param array|string $columns
- *
+ * @param string|array $value
+ * @param array|string $columns
* @return Model|\LdapRecord\Query\Collection|static|null
*/
public function findByAnr($value, $columns = ['*'])
@@ -178,9 +172,8 @@ class Builder extends BaseBuilder
*
* If a record is not found, an exception is thrown.
*
- * @param string $value
- * @param array|string $columns
- *
+ * @param string $value
+ * @param array|string $columns
* @return Model
*
* @throws ModelNotFoundException
@@ -197,8 +190,8 @@ class Builder extends BaseBuilder
/**
* Throws a not found exception.
*
- * @param string $query
- * @param string $dn
+ * @param string $query
+ * @param string $dn
*
* @throws ModelNotFoundException
*/
@@ -210,9 +203,8 @@ class Builder extends BaseBuilder
/**
* Finds multiple records using ambiguous name resolution.
*
- * @param array $values
- * @param array $columns
- *
+ * @param array $values
+ * @param array $columns
* @return \LdapRecord\Query\Collection
*/
public function findManyByAnr(array $values = [], $columns = ['*'])
@@ -233,8 +225,7 @@ class Builder extends BaseBuilder
/**
* Creates an ANR equivalent query for LDAP distributions that do not support ANR.
*
- * @param string $value
- *
+ * @param string $value
* @return $this
*/
protected function prepareAnrEquivalentQuery($value)
@@ -249,9 +240,8 @@ class Builder extends BaseBuilder
/**
* Finds a record by its string GUID.
*
- * @param string $guid
- * @param array|string $columns
- *
+ * @param string $guid
+ * @param array|string $columns
* @return Model|static|null
*/
public function findByGuid($guid, $columns = ['*'])
@@ -268,9 +258,8 @@ class Builder extends BaseBuilder
*
* Fails upon no records returned.
*
- * @param string $guid
- * @param array|string $columns
- *
+ * @param string $guid
+ * @param array|string $columns
* @return Model|static
*
* @throws ModelNotFoundException
@@ -299,8 +288,7 @@ class Builder extends BaseBuilder
/**
* Apply the query scopes and execute the callback.
*
- * @param Closure $callback
- *
+ * @param Closure $callback
* @return mixed
*/
protected function afterScopes(Closure $callback)
@@ -339,9 +327,8 @@ class Builder extends BaseBuilder
/**
* Register a new global scope.
*
- * @param string $identifier
- * @param Scope|\Closure $scope
- *
+ * @param string $identifier
+ * @param Scope|\Closure $scope
* @return $this
*/
public function withGlobalScope($identifier, $scope)
@@ -354,8 +341,7 @@ class Builder extends BaseBuilder
/**
* Remove a registered global scope.
*
- * @param Scope|string $scope
- *
+ * @param Scope|string $scope
* @return $this
*/
public function withoutGlobalScope($scope)
@@ -374,8 +360,7 @@ class Builder extends BaseBuilder
/**
* Remove all or passed registered global scopes.
*
- * @param array|null $scopes
- *
+ * @param array|null $scopes
* @return $this
*/
public function withoutGlobalScopes(array $scopes = null)
@@ -414,8 +399,7 @@ class Builder extends BaseBuilder
/**
* Processes and converts the given LDAP results into models.
*
- * @param array $results
- *
+ * @param array $results
* @return \LdapRecord\Query\Collection
*/
protected function process(array $results)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php
index c22563cf..99c2e85e 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/ObjectNotFoundException.php
@@ -23,9 +23,8 @@ class ObjectNotFoundException extends LdapRecordException
/**
* Create a new exception for the executed filter.
*
- * @param string $query
- * @param ?string $baseDn
- *
+ * @param string $query
+ * @param ?string $baseDn
* @return static
*/
public static function forQuery($query, $baseDn = null)
@@ -36,9 +35,8 @@ class ObjectNotFoundException extends LdapRecordException
/**
* Set the query that was used.
*
- * @param string $query
- * @param string|null $baseDn
- *
+ * @param string $query
+ * @param string|null $baseDn
* @return $this
*/
public function setQuery($query, $baseDn = null)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php
index e2b04824..11e2dc54 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/AbstractPaginator.php
@@ -38,7 +38,7 @@ abstract class AbstractPaginator
/**
* Constructor.
*
- * @param Builder $query
+ * @param Builder $query
*/
public function __construct(Builder $query, $filter, $perPage, $isCritical)
{
@@ -51,8 +51,7 @@ abstract class AbstractPaginator
/**
* Execute the pagination request.
*
- * @param LdapInterface $ldap
- *
+ * @param LdapInterface $ldap
* @return array
*/
public function execute(LdapInterface $ldap)
@@ -107,8 +106,7 @@ abstract class AbstractPaginator
/**
* Apply the server controls.
*
- * @param LdapInterface $ldap
- *
+ * @param LdapInterface $ldap
* @return void
*/
abstract protected function applyServerControls(LdapInterface $ldap);
@@ -116,8 +114,7 @@ abstract class AbstractPaginator
/**
* Reset the server controls.
*
- * @param LdapInterface $ldap
- *
+ * @param LdapInterface $ldap
* @return void
*/
abstract protected function resetServerControls(LdapInterface $ldap);
@@ -125,9 +122,8 @@ abstract class AbstractPaginator
/**
* Update the server controls.
*
- * @param LdapInterface $ldap
- * @param resource $resource
- *
+ * @param LdapInterface $ldap
+ * @param resource $resource
* @return void
*/
abstract protected function updateServerControls(LdapInterface $ldap, $resource);
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php
index b9df77e4..8b12d526 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Pagination/LazyPaginator.php
@@ -9,8 +9,7 @@ class LazyPaginator extends Paginator
/**
* Execute the pagination request.
*
- * @param LdapInterface $ldap
- *
+ * @param LdapInterface $ldap
* @return \Generator
*/
public function execute(LdapInterface $ldap)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Slice.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Slice.php
new file mode 100644
index 00000000..12faa5bd
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Query/Slice.php
@@ -0,0 +1,283 @@
+<?php
+
+namespace LdapRecord\Query;
+
+use ArrayAccess;
+use ArrayIterator;
+use IteratorAggregate;
+use JsonSerializable;
+
+class Slice implements ArrayAccess, IteratorAggregate, JsonSerializable
+{
+ /**
+ * All of the items being paginated.
+ *
+ * @var \LdapRecord\Query\Collection|array
+ */
+ protected $items;
+
+ /**
+ * The number of items to be shown per page.
+ *
+ * @var int
+ */
+ protected $perPage;
+
+ /**
+ * The total number of items before slicing.
+ *
+ * @var int
+ */
+ protected $total;
+
+ /**
+ * The last available page.
+ *
+ * @var int
+ */
+ protected $lastPage;
+
+ /**
+ * The current page being "viewed".
+ *
+ * @var int
+ */
+ protected $currentPage;
+
+ /**
+ * Constructor.
+ *
+ * @param \LdapRecord\Query\Collection|array $items
+ * @param int $total
+ * @param int $perPage
+ * @param int|null $currentPage
+ */
+ public function __construct($items, $total, $perPage, $currentPage = null)
+ {
+ $this->items = $items;
+ $this->total = $total;
+ $this->perPage = $perPage;
+ $this->lastPage = max((int) ceil($total / $perPage), 1);
+ $this->currentPage = $currentPage ?? 1;
+ }
+
+ /**
+ * Get the slice of items being paginated.
+ *
+ * @return \LdapRecord\Query\Collection|array
+ */
+ public function items()
+ {
+ return $this->items;
+ }
+
+ /**
+ * Get the total number of items being paginated.
+ *
+ * @return int
+ */
+ public function total()
+ {
+ return $this->total;
+ }
+
+ /**
+ * Get the number of items shown per page.
+ *
+ * @return int
+ */
+ public function perPage()
+ {
+ return $this->perPage;
+ }
+
+ /**
+ * Determine if there are more items in the data source.
+ *
+ * @return bool
+ */
+ public function hasMorePages()
+ {
+ return $this->currentPage() < $this->lastPage();
+ }
+
+ /**
+ * Determine if there are enough items to split into multiple pages.
+ *
+ * @return bool
+ */
+ public function hasPages()
+ {
+ return $this->currentPage() != 1 || $this->hasMorePages();
+ }
+
+ /**
+ * Determine if the paginator is on the first page.
+ *
+ * @return bool
+ */
+ public function onFirstPage()
+ {
+ return $this->currentPage() <= 1;
+ }
+
+ /**
+ * Determine if the paginator is on the last page.
+ *
+ * @return bool
+ */
+ public function onLastPage()
+ {
+ return ! $this->hasMorePages();
+ }
+
+ /**
+ * Get the current page.
+ *
+ * @return int
+ */
+ public function currentPage()
+ {
+ return $this->currentPage;
+ }
+
+ /**
+ * Get the last page.
+ *
+ * @return int
+ */
+ public function lastPage()
+ {
+ return $this->lastPage;
+ }
+
+ /**
+ * Get an iterator for the items.
+ *
+ * @return \ArrayIterator
+ */
+ #[\ReturnTypeWillChange]
+ public function getIterator()
+ {
+ return new ArrayIterator($this->items);
+ }
+
+ /**
+ * Determine if the list of items is empty.
+ *
+ * @return bool
+ */
+ public function isEmpty()
+ {
+ return empty($this->items);
+ }
+
+ /**
+ * Determine if the list of items is not empty.
+ *
+ * @return bool
+ */
+ public function isNotEmpty()
+ {
+ return ! $this->isEmpty();
+ }
+
+ /**
+ * Get the number of items for the current page.
+ *
+ * @return int
+ */
+ #[\ReturnTypeWillChange]
+ public function count()
+ {
+ return count($this->items);
+ }
+
+ /**
+ * Determine if the given item exists.
+ *
+ * @param mixed $key
+ * @return bool
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetExists($key)
+ {
+ return array_key_exists($key, $this->items);
+ }
+
+ /**
+ * Get the item at the given offset.
+ *
+ * @param mixed $key
+ * @return mixed
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($key)
+ {
+ return $this->items[$key] ?? null;
+ }
+
+ /**
+ * Set the item at the given offset.
+ *
+ * @param mixed $key
+ * @param mixed $value
+ * @return void
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetSet($key, $value)
+ {
+ $this->items[$key] = $value;
+ }
+
+ /**
+ * Unset the item at the given key.
+ *
+ * @param mixed $key
+ * @return void
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetUnset($key)
+ {
+ unset($this->items[$key]);
+ }
+
+ /**
+ * Convert the object into something JSON serializable.
+ *
+ * @return array
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return $this->toArray();
+ }
+
+ /**
+ * Get the arrayable items.
+ *
+ * @return array
+ */
+ public function getArrayableItems()
+ {
+ return $this->items instanceof Collection
+ ? $this->items->all()
+ : $this->items;
+ }
+
+ /**
+ * Get the instance as an array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return [
+ 'current_page' => $this->currentPage(),
+ 'data' => $this->getArrayableItems(),
+ 'last_page' => $this->lastPage(),
+ 'per_page' => $this->perPage(),
+ 'total' => $this->total(),
+ ];
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Arr.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Arr.php
index 8fa87a2b..7475859a 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Arr.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Arr.php
@@ -9,8 +9,7 @@ class Arr
/**
* Determine whether the given value is array accessible.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return bool
*/
public static function accessible($value)
@@ -21,9 +20,8 @@ class Arr
/**
* Determine if the given key exists in the provided array.
*
- * @param \ArrayAccess|array $array
- * @param string|int $key
- *
+ * @param \ArrayAccess|array $array
+ * @param string|int $key
* @return bool
*/
public static function exists($array, $key)
@@ -38,8 +36,7 @@ class Arr
/**
* If the given value is not an array and not null, wrap it in one.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return array
*/
public static function wrap($value)
@@ -54,10 +51,9 @@ class Arr
/**
* Return the first element in an array passing a given truth test.
*
- * @param iterable $array
- * @param callable|null $callback
- * @param mixed $default
- *
+ * @param iterable $array
+ * @param callable|null $callback
+ * @param mixed $default
* @return mixed
*/
public static function first($array, callable $callback = null, $default = null)
@@ -84,10 +80,9 @@ class Arr
/**
* Return the last element in an array passing a given truth test.
*
- * @param array $array
- * @param callable|null $callback
- * @param mixed $default
- *
+ * @param array $array
+ * @param callable|null $callback
+ * @param mixed $default
* @return mixed
*/
public static function last($array, callable $callback = null, $default = null)
@@ -102,10 +97,9 @@ class Arr
/**
* Get an item from an array using "dot" notation.
*
- * @param ArrayAccess|array $array
- * @param string|int|null $key
- * @param mixed $default
- *
+ * @param ArrayAccess|array $array
+ * @param string|int|null $key
+ * @param mixed $default
* @return mixed
*/
public static function get($array, $key, $default = null)
@@ -122,7 +116,7 @@ class Arr
return $array[$key];
}
- if (strpos($key, '.') === false) {
+ if (str_contains($key, '.')) {
return $array[$key] ?? Helpers::value($default);
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Helpers.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Helpers.php
index a55d1d22..ab217d6f 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Helpers.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Helpers.php
@@ -9,12 +9,12 @@ class Helpers
/**
* Return the default value of the given value.
*
- * @param mixed $value
- *
+ * @param mixed $value
+ * @param mixed $args
* @return mixed
*/
- public static function value($value)
+ public static function value($value, ...$args)
{
- return $value instanceof Closure ? $value() : $value;
+ return $value instanceof Closure ? $value(...$args) : $value;
}
}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Str.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Str.php
new file mode 100644
index 00000000..820834e2
--- /dev/null
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Support/Str.php
@@ -0,0 +1,129 @@
+<?php
+
+namespace LdapRecord\Support;
+
+class Str
+{
+ /**
+ * Return the remainder of a string after the last occurrence of a given value.
+ *
+ * @param string $subject
+ * @param string $search
+ * @return string
+ */
+ public static function afterLast($subject, $search)
+ {
+ if ($search === '') {
+ return $subject;
+ }
+
+ $position = strrpos($subject, (string) $search);
+
+ if ($position === false) {
+ return $subject;
+ }
+
+ return substr($subject, $position + strlen($search));
+ }
+
+ /**
+ * Determine if a given string starts with a given substring.
+ *
+ * @param string $haystack
+ * @param string|string[] $needles
+ * @return bool
+ */
+ public static function startsWith($haystack, $needles)
+ {
+ foreach ((array) $needles as $needle) {
+ if ((string) $needle !== '' && str_starts_with($haystack, $needle)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determine if a given string ends with a given substring.
+ *
+ * @param string $haystack
+ * @param string|string[] $needles
+ * @return bool
+ */
+ public static function endsWith($haystack, $needles)
+ {
+ foreach ((array) $needles as $needle) {
+ if (
+ $needle !== '' && $needle !== null
+ && str_ends_with($haystack, $needle)
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Execute a callback when a needle is found in the haystack.
+ *
+ * @param string $haystack
+ * @param string|string[] $needles
+ * @param \Closure|mixed $callback
+ * @param \Closure|mixed $default
+ * @return mixed
+ */
+ public static function whenContains($haystack, $needles, $callback, $default = null)
+ {
+ foreach ((array) $needles as $needle) {
+ if (static::contains($haystack, $needle)) {
+ return Helpers::value($callback, $needle, $haystack);
+ }
+ }
+
+ return Helpers::value($default, $haystack);
+ }
+
+ /**
+ * Determine if a given string contains a given substring.
+ *
+ * @param string $haystack
+ * @param string|string[] $needles
+ * @param bool $ignoreCase
+ * @return bool
+ */
+ public static function contains($haystack, $needles, $ignoreCase = false)
+ {
+ if ($ignoreCase) {
+ $haystack = mb_strtolower($haystack);
+ $needles = array_map('mb_strtolower', (array) $needles);
+ }
+
+ foreach ((array) $needles as $needle) {
+ if ($needle !== '' && str_contains((string) $haystack, $needle)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the number of substring occurrences.
+ *
+ * @param string $haystack
+ * @param string $needle
+ * @param int $offset
+ * @param int|null $length
+ * @return int
+ */
+ public static function substrCount($haystack, $needle, $offset = 0, $length = null)
+ {
+ if (! is_null($length)) {
+ return substr_count($haystack, $needle, $offset, $length);
+ } else {
+ return substr_count($haystack, $needle, $offset);
+ }
+ }
+}
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/ConnectionFake.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/ConnectionFake.php
index 0aa12a1e..09530f5c 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/ConnectionFake.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/ConnectionFake.php
@@ -25,9 +25,8 @@ class ConnectionFake extends Connection
/**
* Make a new fake LDAP connection instance.
*
- * @param array $config
- * @param string $ldap
- *
+ * @param array $config
+ * @param string $ldap
* @return static
*/
public static function make(array $config = [], $ldap = LdapFake::class)
@@ -42,8 +41,7 @@ class ConnectionFake extends Connection
/**
* Set the user to authenticate as.
*
- * @param Model|string $user
- *
+ * @param Model|string $user
* @return $this
*/
public function actingAs($user)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php
index 9d50dcdf..72be02af 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/DirectoryFake.php
@@ -9,8 +9,7 @@ class DirectoryFake
/**
* Setup the fake connection.
*
- * @param string|null $name
- *
+ * @param string|null $name
* @return ConnectionFake
*
* @throws \LdapRecord\ContainerException
@@ -42,8 +41,7 @@ class DirectoryFake
/**
* Make a connection fake.
*
- * @param array $config
- *
+ * @param array $config
* @return ConnectionFake
*/
public static function makeConnectionFake(array $config = [])
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapExpectation.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapExpectation.php
index 90a5fa2e..69345914 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapExpectation.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapExpectation.php
@@ -2,7 +2,9 @@
namespace LdapRecord\Testing;
+use Closure;
use LdapRecord\LdapRecordException;
+use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
use PHPUnit\Framework\Constraint\IsEqual;
use UnexpectedValueException;
@@ -82,7 +84,7 @@ class LdapExpectation
/**
* Constructor.
*
- * @param string $method
+ * @param string $method
*/
public function __construct($method)
{
@@ -92,21 +94,22 @@ class LdapExpectation
/**
* Set the arguments that the operation should receive.
*
- * @param mixed $args
- *
+ * @param mixed $args
* @return $this
*/
public function with($args)
{
- $args = is_array($args) ? $args : func_get_args();
+ $this->args = array_map(function ($arg) {
+ if ($arg instanceof Closure) {
+ return new Callback($arg);
+ }
- foreach ($args as $key => $arg) {
if (! $arg instanceof Constraint) {
- $args[$key] = new IsEqual($arg);
+ return new IsEqual($arg);
}
- }
- $this->args = $args;
+ return $arg;
+ }, is_array($args) ? $args : func_get_args());
return $this;
}
@@ -114,8 +117,7 @@ class LdapExpectation
/**
* Set the expected value to return.
*
- * @param mixed $value
- *
+ * @param mixed $value
* @return $this
*/
public function andReturn($value)
@@ -128,10 +130,9 @@ class LdapExpectation
/**
* The error message to return from the expectation.
*
- * @param int $code
- * @param string $error
- * @param string $diagnosticMessage
- *
+ * @param int $code
+ * @param string $error
+ * @param string $diagnosticMessage
* @return $this
*/
public function andReturnError($code = 1, $error = '', $diagnosticMessage = '')
@@ -148,8 +149,7 @@ class LdapExpectation
/**
* Set the expected exception to throw.
*
- * @param string|\Exception|LdapRecordException $exception
- *
+ * @param string|\Exception|LdapRecordException $exception
* @return $this
*/
public function andThrow($exception)
@@ -186,8 +186,7 @@ class LdapExpectation
/**
* Set the expectation to be called the given number of times.
*
- * @param int $count
- *
+ * @param int $count
* @return $this
*/
public function times($count = 1)
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php
index 00470e14..5a000354 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Testing/LdapFake.php
@@ -47,8 +47,7 @@ class LdapFake implements LdapInterface
/**
* Create a new expected operation.
*
- * @param string $method
- *
+ * @param string $method
* @return LdapExpectation
*/
public static function operation($method)
@@ -59,8 +58,7 @@ class LdapFake implements LdapInterface
/**
* Set the user that will pass binding.
*
- * @param string $dn
- *
+ * @param string $dn
* @return $this
*/
public function shouldAuthenticateWith($dn)
@@ -73,8 +71,7 @@ class LdapFake implements LdapInterface
/**
* Add an LDAP method expectation.
*
- * @param LdapExpectation|array $expectations
- *
+ * @param LdapExpectation|array $expectations
* @return $this
*/
public function expect($expectations = [])
@@ -105,8 +102,7 @@ class LdapFake implements LdapInterface
/**
* Determine if the method has any expectations.
*
- * @param string $method
- *
+ * @param string $method
* @return bool
*/
public function hasExpectations($method)
@@ -117,8 +113,7 @@ class LdapFake implements LdapInterface
/**
* Get expectations by method.
*
- * @param string $method
- *
+ * @param string $method
* @return LdapExpectation[]|mixed
*/
public function getExpectations($method)
@@ -129,9 +124,8 @@ class LdapFake implements LdapInterface
/**
* Remove an expectation by method and key.
*
- * @param string $method
- * @param int $key
- *
+ * @param string $method
+ * @param int $key
* @return void
*/
public function removeExpectation($method, $key)
@@ -142,8 +136,7 @@ class LdapFake implements LdapInterface
/**
* Set the error number of a failed bind attempt.
*
- * @param int $number
- *
+ * @param int $number
* @return $this
*/
public function shouldReturnErrorNumber($number = 1)
@@ -156,8 +149,7 @@ class LdapFake implements LdapInterface
/**
* Set the last error of a failed bind attempt.
*
- * @param string $message
- *
+ * @param string $message
* @return $this
*/
public function shouldReturnError($message = '')
@@ -170,8 +162,7 @@ class LdapFake implements LdapInterface
/**
* Set the diagnostic message of a failed bind attempt.
*
- * @param string $message
- *
+ * @param string $message
* @return $this
*/
public function shouldReturnDiagnosticMessage($message = '')
@@ -261,6 +252,16 @@ class LdapFake implements LdapInterface
: $this->bound;
}
+ /**
+ * @inheritdoc
+ */
+ public function getHost()
+ {
+ return $this->hasExpectations('getHost')
+ ? $this->resolveExpectation('getHost')
+ : $this->host;
+ }
+
/**
* @inheritdoc
*/
@@ -454,9 +455,8 @@ class LdapFake implements LdapInterface
/**
* Resolve the methods expectations.
*
- * @param string $method
- * @param array $args
- *
+ * @param string $method
+ * @param array $args
* @return mixed
*
* @throws Exception
@@ -489,8 +489,7 @@ class LdapFake implements LdapInterface
/**
* Apply the expectation error to the fake.
*
- * @param LdapExpectation $expectation
- *
+ * @param LdapExpectation $expectation
* @return void
*/
protected function applyExpectationError(LdapExpectation $expectation)
@@ -503,10 +502,9 @@ class LdapFake implements LdapInterface
/**
* Assert that the expected arguments match the operations arguments.
*
- * @param string $method
- * @param Constraint[] $expectedArgs
- * @param array $methodArgs
- *
+ * @param string $method
+ * @param Constraint[] $expectedArgs
+ * @param array $methodArgs
* @return void
*/
protected function assertMethodArgumentsMatch($method, array $expectedArgs = [], array $methodArgs = [])
diff --git a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php
index 01d55c79..c4f5190d 100644
--- a/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php
+++ b/data/web/inc/lib/vendor/directorytree/ldaprecord/src/Utilities.php
@@ -10,14 +10,13 @@ class Utilities
* This will also decode hex characters into their true
* UTF-8 representation embedded inside the DN as well.
*
- * @param string $dn
- * @param bool $removeAttributePrefixes
- *
+ * @param string $dn
+ * @param bool $removeAttributePrefixes
* @return array|false
*/
public static function explodeDn($dn, $removeAttributePrefixes = true)
{
- $dn = ldap_explode_dn($dn, ($removeAttributePrefixes ? 1 : 0));
+ $dn = ldap_explode_dn($dn, $removeAttributePrefixes ? 1 : 0);
if (! is_array($dn)) {
return false;
@@ -39,8 +38,7 @@ class Utilities
/**
* Un-escapes a hexadecimal string into its original string representation.
*
- * @param string $value
- *
+ * @param string $value
* @return string
*/
public static function unescape($value)
@@ -58,8 +56,7 @@ class Utilities
* @see https://github.com/ChadSikorra
* @see https://stackoverflow.com/questions/39533560/php-ldap-get-user-sid
*
- * @param string $value The Binary SID
- *
+ * @param string $value The Binary SID
* @return string|null
*/
public static function binarySidToString($value)
@@ -106,8 +103,7 @@ class Utilities
/**
* Convert a binary GUID to a string GUID.
*
- * @param string $binGuid
- *
+ * @param string $binGuid
* @return string|null
*/
public static function binaryGuidToString($binGuid)
@@ -130,8 +126,7 @@ class Utilities
/**
* Converts a string GUID to it's hex variant.
*
- * @param string $string
- *
+ * @param string $string
* @return string
*/
public static function stringGuidToHex($string)
@@ -149,21 +144,19 @@ class Utilities
* Round a Windows timestamp down to seconds and remove
* the seconds between 1601-01-01 and 1970-01-01.
*
- * @param float $windowsTime
- *
- * @return float
+ * @param int $windowsTime
+ * @return int
*/
public static function convertWindowsTimeToUnixTime($windowsTime)
{
- return round($windowsTime / 10000000) - 11644473600;
+ return (int) (round($windowsTime / 10000000) - 11644473600);
}
/**
* Convert a Unix timestamp to Windows timestamp.
*
- * @param float $unixTime
- *
- * @return float
+ * @param int $unixTime
+ * @return int
*/
public static function convertUnixTimeToWindowsTime($unixTime)
{
@@ -173,8 +166,7 @@ class Utilities
/**
* Validates that the inserted string is an object SID.
*
- * @param string $sid
- *
+ * @param string $sid
* @return bool
*/
public static function isValidSid($sid)
@@ -185,8 +177,7 @@ class Utilities
/**
* Validates that the inserted string is an object GUID.
*
- * @param string $guid
- *
+ * @param string $guid
* @return bool
*/
public static function isValidGuid($guid)
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Auth/Access/Gate.php b/data/web/inc/lib/vendor/illuminate/contracts/Auth/Access/Gate.php
index b88ab179..eb605d82 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Auth/Access/Gate.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Auth/Access/Gate.php
@@ -57,18 +57,18 @@ interface Gate
public function after(callable $callback);
/**
- * Determine if the given ability should be granted for the current user.
+ * Determine if all of the given abilities should be granted for the current user.
*
- * @param string $ability
+ * @param iterable|string $ability
* @param array|mixed $arguments
* @return bool
*/
public function allows($ability, $arguments = []);
/**
- * Determine if the given ability should be denied for the current user.
+ * Determine if any of the given abilities should be denied for the current user.
*
- * @param string $ability
+ * @param iterable|string $ability
* @param array|mixed $arguments
* @return bool
*/
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBeUnique.php b/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBeUnique.php
new file mode 100644
index 00000000..c72b7a80
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Broadcasting/ShouldBeUnique.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Broadcasting;
+
+interface ShouldBeUnique
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Cache/Repository.php b/data/web/inc/lib/vendor/illuminate/contracts/Cache/Repository.php
index 5b78af57..4bc4638e 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Cache/Repository.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Cache/Repository.php
@@ -10,9 +10,11 @@ interface Repository extends CacheInterface
/**
* Retrieve an item from the cache and delete it.
*
- * @param string $key
- * @param mixed $default
- * @return mixed
+ * @template TCacheValue
+ *
+ * @param array|string $key
+ * @param TCacheValue|(\Closure(): TCacheValue) $default
+ * @return (TCacheValue is null ? mixed : TCacheValue)
*/
public function pull($key, $default = null);
@@ -66,28 +68,34 @@ interface Repository extends CacheInterface
/**
* Get an item from the cache, or execute the given Closure and store the result.
*
+ * @template TCacheValue
+ *
* @param string $key
- * @param \DateTimeInterface|\DateInterval|int|null $ttl
- * @param \Closure $callback
- * @return mixed
+ * @param \DateTimeInterface|\DateInterval|\Closure|int|null $ttl
+ * @param \Closure(): TCacheValue $callback
+ * @return TCacheValue
*/
public function remember($key, $ttl, Closure $callback);
/**
* Get an item from the cache, or execute the given Closure and store the result forever.
*
+ * @template TCacheValue
+ *
* @param string $key
- * @param \Closure $callback
- * @return mixed
+ * @param \Closure(): TCacheValue $callback
+ * @return TCacheValue
*/
public function sear($key, Closure $callback);
/**
* Get an item from the cache, or execute the given Closure and store the result forever.
*
+ * @template TCacheValue
+ *
* @param string $key
- * @param \Closure $callback
- * @return mixed
+ * @param \Closure(): TCacheValue $callback
+ * @return TCacheValue
*/
public function rememberForever($key, Closure $callback);
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Console/Isolatable.php b/data/web/inc/lib/vendor/illuminate/contracts/Console/Isolatable.php
new file mode 100644
index 00000000..d652be3b
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Console/Isolatable.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Console;
+
+interface Isolatable
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Console/PromptsForMissingInput.php b/data/web/inc/lib/vendor/illuminate/contracts/Console/PromptsForMissingInput.php
new file mode 100644
index 00000000..ccac1eda
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Console/PromptsForMissingInput.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Console;
+
+interface PromptsForMissingInput
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php b/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php
index 7d7f2c96..1472a2e5 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Container/Container.php
@@ -53,6 +53,15 @@ interface Container extends ContainerInterface
*/
public function bind($abstract, $concrete = null, $shared = false);
+ /**
+ * Bind a callback to resolve with Container::call.
+ *
+ * @param array|string $method
+ * @param \Closure $callback
+ * @return void
+ */
+ public function bindMethod($method, $callback);
+
/**
* Register a binding if it hasn't already been registered.
*
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php b/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php
index 1fc7fc15..1d84ef8c 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php
@@ -32,7 +32,7 @@ interface ContextualBindingBuilder
* Specify the configuration item to bind as a primitive.
*
* @param string $key
- * @param ?string $default
+ * @param mixed $default
* @return void
*/
public function giveConfig($key, $default = null);
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Cookie/QueueingFactory.php b/data/web/inc/lib/vendor/illuminate/contracts/Cookie/QueueingFactory.php
index d6c74b8f..2d5f51ac 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Cookie/QueueingFactory.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Cookie/QueueingFactory.php
@@ -7,7 +7,7 @@ interface QueueingFactory extends Factory
/**
* Queue a cookie to send with the next response.
*
- * @param array $parameters
+ * @param mixed ...$parameters
* @return void
*/
public function queue(...$parameters);
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Castable.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Castable.php
index 911b1cf8..776d4fc3 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Castable.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/Castable.php
@@ -8,8 +8,7 @@ interface Castable
* Get the name of the caster class to use when casting from / to this cast target.
*
* @param array $arguments
- * @return string
- * @return string|\Illuminate\Contracts\Database\Eloquent\CastsAttributes|\Illuminate\Contracts\Database\Eloquent\CastsInboundAttributes
+ * @return class-string<CastsAttributes|CastsInboundAttributes>|CastsAttributes|CastsInboundAttributes
*/
public static function castUsing(array $arguments);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php
index 808d005f..89cec66a 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php
@@ -2,6 +2,12 @@
namespace Illuminate\Contracts\Database\Eloquent;
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * @template TGet
+ * @template TSet
+ */
interface CastsAttributes
{
/**
@@ -10,19 +16,19 @@ interface CastsAttributes
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
- * @param array $attributes
- * @return mixed
+ * @param array<string, mixed> $attributes
+ * @return TGet|null
*/
- public function get($model, string $key, $value, array $attributes);
+ public function get(Model $model, string $key, mixed $value, array $attributes);
/**
* Transform the attribute to its underlying model values.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
- * @param mixed $value
- * @param array $attributes
+ * @param TSet|null $value
+ * @param array<string, mixed> $attributes
* @return mixed
*/
- public function set($model, string $key, $value, array $attributes);
+ public function set(Model $model, string $key, mixed $value, array $attributes);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php
index 4c7801b5..6a3e2ef1 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php
@@ -2,6 +2,8 @@
namespace Illuminate\Contracts\Database\Eloquent;
+use Illuminate\Database\Eloquent\Model;
+
interface CastsInboundAttributes
{
/**
@@ -13,5 +15,5 @@ interface CastsInboundAttributes
* @param array $attributes
* @return mixed
*/
- public function set($model, string $key, $value, array $attributes);
+ public function set(Model $model, string $key, mixed $value, array $attributes);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php
index a89f9101..a2ecf16f 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Eloquent/SerializesCastableAttributes.php
@@ -2,6 +2,8 @@
namespace Illuminate\Contracts\Database\Eloquent;
+use Illuminate\Database\Eloquent\Model;
+
interface SerializesCastableAttributes
{
/**
@@ -13,5 +15,5 @@ interface SerializesCastableAttributes
* @param array $attributes
* @return mixed
*/
- public function serialize($model, string $key, $value, array $attributes);
+ public function serialize(Model $model, string $key, mixed $value, array $attributes);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/ModelIdentifier.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/ModelIdentifier.php
index 9893d280..aacd18c0 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Database/ModelIdentifier.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/ModelIdentifier.php
@@ -34,6 +34,13 @@ class ModelIdentifier
*/
public $connection;
+ /**
+ * The class name of the model collection.
+ *
+ * @var string|null
+ */
+ public $collectionClass;
+
/**
* Create a new model identifier.
*
@@ -50,4 +57,17 @@ class ModelIdentifier
$this->relations = $relations;
$this->connection = $connection;
}
+
+ /**
+ * Specify the collection class that should be used when serializing / restoring collections.
+ *
+ * @param string|null $collectionClass
+ * @return $this
+ */
+ public function useCollectionClass(?string $collectionClass)
+ {
+ $this->collectionClass = $collectionClass;
+
+ return $this;
+ }
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/ConditionExpression.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/ConditionExpression.php
new file mode 100644
index 00000000..b2e97a6e
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/ConditionExpression.php
@@ -0,0 +1,7 @@
+<?php
+
+namespace Illuminate\Contracts\Database\Query;
+
+interface ConditionExpression extends Expression
+{
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Expression.php b/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Expression.php
new file mode 100644
index 00000000..9e08682f
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Database/Query/Expression.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace Illuminate\Contracts\Database\Query;
+
+use Illuminate\Database\Grammar;
+
+interface Expression
+{
+ /**
+ * Get the value of the expression.
+ *
+ * @param \Illuminate\Database\Grammar $grammar
+ * @return string|int|float
+ */
+ public function getValue(Grammar $grammar);
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Events/Dispatcher.php b/data/web/inc/lib/vendor/illuminate/contracts/Events/Dispatcher.php
index 63861069..7f4096af 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Events/Dispatcher.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Events/Dispatcher.php
@@ -34,7 +34,7 @@ interface Dispatcher
*
* @param string|object $event
* @param mixed $payload
- * @return array|null
+ * @return mixed
*/
public function until($event, $payload = []);
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldDispatchAfterCommit.php b/data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldDispatchAfterCommit.php
new file mode 100644
index 00000000..8f1fbdd4
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldDispatchAfterCommit.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Events;
+
+interface ShouldDispatchAfterCommit
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldHandleEventsAfterCommit.php b/data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldHandleEventsAfterCommit.php
new file mode 100644
index 00000000..8c705103
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Events/ShouldHandleEventsAfterCommit.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Events;
+
+interface ShouldHandleEventsAfterCommit
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php b/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php
index 6d2fd578..e92d7efc 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Filesystem/Filesystem.php
@@ -46,7 +46,7 @@ interface Filesystem
* Write the contents of a file.
*
* @param string $path
- * @param string|resource $contents
+ * @param \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents
* @param mixed $options
* @return bool
*/
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php
index b46c6de4..f768eb96 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Foundation/Application.php
@@ -45,6 +45,22 @@ interface Application extends Container
*/
public function databasePath($path = '');
+ /**
+ * Get the path to the language files.
+ *
+ * @param string $path
+ * @return string
+ */
+ public function langPath($path = '');
+
+ /**
+ * Get the path to the public directory.
+ *
+ * @param string $path
+ * @return string
+ */
+ public function publicPath($path = '');
+
/**
* Get the path to the resources directory.
*
@@ -64,7 +80,7 @@ interface Application extends Container
/**
* Get or check the current application environment.
*
- * @param string|array $environments
+ * @param string|array ...$environments
* @return string|bool
*/
public function environment(...$environments);
@@ -83,6 +99,13 @@ interface Application extends Container
*/
public function runningUnitTests();
+ /**
+ * Determine if the application is running with debug mode enabled.
+ *
+ * @return bool
+ */
+ public function hasDebugModeEnabled();
+
/**
* Get an instance of the maintenance mode manager implementation.
*
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Attachable.php b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Attachable.php
new file mode 100644
index 00000000..6804ec3d
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Attachable.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace Illuminate\Contracts\Mail;
+
+interface Attachable
+{
+ /**
+ * Get an attachment instance for this entity.
+ *
+ * @return \Illuminate\Mail\Attachment
+ */
+ public function toMailAttachment();
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php
index c5df7e85..b7fdd42e 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailable.php
@@ -10,7 +10,7 @@ interface Mailable
* Send the message using the given mailer.
*
* @param \Illuminate\Contracts\Mail\Factory|\Illuminate\Contracts\Mail\Mailer $mailer
- * @return void
+ * @return \Illuminate\Mail\SentMessage|null
*/
public function send($mailer);
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php
index 38f9e3b5..4d97f3ea 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Mail/Mailer.php
@@ -25,7 +25,7 @@ interface Mailer
*
* @param string $text
* @param mixed $callback
- * @return void
+ * @return \Illuminate\Mail\SentMessage|null
*/
public function raw($text, $callback);
@@ -35,7 +35,7 @@ interface Mailer
* @param \Illuminate\Contracts\Mail\Mailable|string|array $view
* @param array $data
* @param \Closure|string|null $callback
- * @return void
+ * @return \Illuminate\Mail\SentMessage|null
*/
public function send($view, array $data = [], $callback = null);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Pagination/CursorPaginator.php b/data/web/inc/lib/vendor/illuminate/contracts/Pagination/CursorPaginator.php
index 2d62d3a5..c6b96fbe 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Pagination/CursorPaginator.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Pagination/CursorPaginator.php
@@ -29,6 +29,13 @@ interface CursorPaginator
*/
public function fragment($fragment = null);
+ /**
+ * Add all current query string values to the paginator.
+ *
+ * @return $this
+ */
+ public function withQueryString();
+
/**
* Get the URL for the previous page, or null.
*
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Pagination/Paginator.php b/data/web/inc/lib/vendor/illuminate/contracts/Pagination/Paginator.php
index 49bafaa7..04201cef 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Pagination/Paginator.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Pagination/Paginator.php
@@ -15,7 +15,7 @@ interface Paginator
/**
* Add a set of query string values to the paginator.
*
- * @param array|string $key
+ * @param array|string|null $key
* @param string|null $value
* @return $this
*/
@@ -25,7 +25,7 @@ interface Paginator
* Get / set the URL fragment to be appended to URLs.
*
* @param string|null $fragment
- * @return $this|string
+ * @return $this|string|null
*/
public function fragment($fragment = null);
@@ -53,14 +53,14 @@ interface Paginator
/**
* Get the "index" of the first item being paginated.
*
- * @return int
+ * @return int|null
*/
public function firstItem();
/**
* Get the "index" of the last item being paginated.
*
- * @return int
+ * @return int|null
*/
public function lastItem();
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Process/InvokedProcess.php b/data/web/inc/lib/vendor/illuminate/contracts/Process/InvokedProcess.php
new file mode 100644
index 00000000..d272d377
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Process/InvokedProcess.php
@@ -0,0 +1,64 @@
+<?php
+
+namespace Illuminate\Contracts\Process;
+
+interface InvokedProcess
+{
+ /**
+ * Get the process ID if the process is still running.
+ *
+ * @return int|null
+ */
+ public function id();
+
+ /**
+ * Send a signal to the process.
+ *
+ * @param int $signal
+ * @return $this
+ */
+ public function signal(int $signal);
+
+ /**
+ * Determine if the process is still running.
+ *
+ * @return bool
+ */
+ public function running();
+
+ /**
+ * Get the standard output for the process.
+ *
+ * @return string
+ */
+ public function output();
+
+ /**
+ * Get the error output for the process.
+ *
+ * @return string
+ */
+ public function errorOutput();
+
+ /**
+ * Get the latest standard output for the process.
+ *
+ * @return string
+ */
+ public function latestOutput();
+
+ /**
+ * Get the latest error output for the process.
+ *
+ * @return string
+ */
+ public function latestErrorOutput();
+
+ /**
+ * Wait for the process to finish.
+ *
+ * @param callable|null $output
+ * @return \Illuminate\Console\Process\ProcessResult
+ */
+ public function wait(callable $output = null);
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Process/ProcessResult.php b/data/web/inc/lib/vendor/illuminate/contracts/Process/ProcessResult.php
new file mode 100644
index 00000000..702701ea
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Process/ProcessResult.php
@@ -0,0 +1,65 @@
+<?php
+
+namespace Illuminate\Contracts\Process;
+
+interface ProcessResult
+{
+ /**
+ * Get the original command executed by the process.
+ *
+ * @return string
+ */
+ public function command();
+
+ /**
+ * Determine if the process was successful.
+ *
+ * @return bool
+ */
+ public function successful();
+
+ /**
+ * Determine if the process failed.
+ *
+ * @return bool
+ */
+ public function failed();
+
+ /**
+ * Get the exit code of the process.
+ *
+ * @return int|null
+ */
+ public function exitCode();
+
+ /**
+ * Get the standard output of the process.
+ *
+ * @return string
+ */
+ public function output();
+
+ /**
+ * Get the error output of the process.
+ *
+ * @return string
+ */
+ public function errorOutput();
+
+ /**
+ * Throw an exception if the process failed.
+ *
+ * @param callable|null $callback
+ * @return $this
+ */
+ public function throw(callable $callback = null);
+
+ /**
+ * Throw an exception if the process failed and the given condition is true.
+ *
+ * @param bool $condition
+ * @param callable|null $callback
+ * @return $this
+ */
+ public function throwIf(bool $condition, callable $callback = null);
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Queue/Monitor.php b/data/web/inc/lib/vendor/illuminate/contracts/Queue/Monitor.php
index 7da62d3a..87677f0e 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Queue/Monitor.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Queue/Monitor.php
@@ -13,7 +13,7 @@ interface Monitor
public function looping($callback);
/**
- * Register a callback to be executed when a job fails after the maximum amount of retries.
+ * Register a callback to be executed when a job fails after the maximum number of retries.
*
* @param mixed $callback
* @return void
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Queue/ShouldQueueAfterCommit.php b/data/web/inc/lib/vendor/illuminate/contracts/Queue/ShouldQueueAfterCommit.php
new file mode 100644
index 00000000..8545ad30
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Queue/ShouldQueueAfterCommit.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Queue;
+
+interface ShouldQueueAfterCommit extends ShouldQueue
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php b/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php
index 86c16cab..0aa51d55 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Routing/ResponseFactory.php
@@ -60,7 +60,7 @@ interface ResponseFactory
/**
* Create a new streamed response instance.
*
- * @param \Closure $callback
+ * @param callable $callback
* @param int $status
* @param array $headers
* @return \Symfony\Component\HttpFoundation\StreamedResponse
@@ -70,7 +70,7 @@ interface ResponseFactory
/**
* Create a new streamed response instance as a file download.
*
- * @param \Closure $callback
+ * @param callable $callback
* @param string|null $name
* @param array $headers
* @param string|null $disposition
@@ -123,7 +123,7 @@ interface ResponseFactory
/**
* Create a new redirect response to a controller action.
*
- * @param string $action
+ * @param array|string $action
* @param mixed $parameters
* @param int $status
* @param array $headers
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php b/data/web/inc/lib/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php
new file mode 100644
index 00000000..113f4200
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php
@@ -0,0 +1,8 @@
+<?php
+
+namespace Illuminate\Contracts\Session\Middleware;
+
+interface AuthenticatesSessions
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Support/MessageBag.php b/data/web/inc/lib/vendor/illuminate/contracts/Support/MessageBag.php
index 7f708aca..14855d06 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Support/MessageBag.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Support/MessageBag.php
@@ -64,6 +64,14 @@ interface MessageBag extends Arrayable, Countable
*/
public function all($format = null);
+ /**
+ * Remove a message from the bag.
+ *
+ * @param string $key
+ * @return $this
+ */
+ public function forget($key);
+
/**
* Get the raw messages in the container.
*
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Translation/Translator.php b/data/web/inc/lib/vendor/illuminate/contracts/Translation/Translator.php
index 6eae4915..ded1a8b8 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Translation/Translator.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Translation/Translator.php
@@ -18,7 +18,7 @@ interface Translator
* Get a translation according to an integer value.
*
* @param string $key
- * @param \Countable|int|array $number
+ * @param \Countable|int|float|array $number
* @param array $replace
* @param string|null $locale
* @return string
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/DataAwareRule.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/DataAwareRule.php
index 7ec7ab5a..739626c2 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Validation/DataAwareRule.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/DataAwareRule.php
@@ -10,5 +10,5 @@ interface DataAwareRule
* @param array $data
* @return $this
*/
- public function setData($data);
+ public function setData(array $data);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/Factory.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/Factory.php
index 104675a4..70687e87 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Validation/Factory.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/Factory.php
@@ -10,10 +10,10 @@ interface Factory
* @param array $data
* @param array $rules
* @param array $messages
- * @param array $customAttributes
+ * @param array $attributes
* @return \Illuminate\Contracts\Validation\Validator
*/
- public function make(array $data, array $rules, array $messages = [], array $customAttributes = []);
+ public function make(array $data, array $rules, array $messages = [], array $attributes = []);
/**
* Register a custom validator extension.
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/ImplicitRule.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/ImplicitRule.php
index bbc64f44..ac5df83f 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Validation/ImplicitRule.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/ImplicitRule.php
@@ -2,6 +2,9 @@
namespace Illuminate\Contracts\Validation;
+/**
+ * @deprecated see ValidationRule
+ */
interface ImplicitRule extends Rule
{
//
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/InvokableRule.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/InvokableRule.php
new file mode 100644
index 00000000..c7ac9c24
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/InvokableRule.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Illuminate\Contracts\Validation;
+
+use Closure;
+
+/**
+ * @deprecated see ValidationRule
+ */
+interface InvokableRule
+{
+ /**
+ * Run the validation rule.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
+ * @return void
+ */
+ public function __invoke(string $attribute, mixed $value, Closure $fail);
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/Rule.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/Rule.php
index cc03777a..102cc534 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Validation/Rule.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/Rule.php
@@ -2,6 +2,9 @@
namespace Illuminate\Contracts\Validation;
+/**
+ * @deprecated see ValidationRule
+ */
interface Rule
{
/**
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidationRule.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidationRule.php
new file mode 100644
index 00000000..1c95b975
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidationRule.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Illuminate\Contracts\Validation;
+
+use Closure;
+
+interface ValidationRule
+{
+ /**
+ * Run the validation rule.
+ *
+ * @param string $attribute
+ * @param mixed $value
+ * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
+ * @return void
+ */
+ public function validate(string $attribute, mixed $value, Closure $fail): void;
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidatorAwareRule.php b/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidatorAwareRule.php
index 053f4fa8..0baf2742 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidatorAwareRule.php
+++ b/data/web/inc/lib/vendor/illuminate/contracts/Validation/ValidatorAwareRule.php
@@ -2,6 +2,8 @@
namespace Illuminate\Contracts\Validation;
+use Illuminate\Validation\Validator;
+
interface ValidatorAwareRule
{
/**
@@ -10,5 +12,5 @@ interface ValidatorAwareRule
* @param \Illuminate\Validation\Validator $validator
* @return $this
*/
- public function setValidator($validator);
+ public function setValidator(Validator $validator);
}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/View/ViewCompilationException.php b/data/web/inc/lib/vendor/illuminate/contracts/View/ViewCompilationException.php
new file mode 100644
index 00000000..5c57619e
--- /dev/null
+++ b/data/web/inc/lib/vendor/illuminate/contracts/View/ViewCompilationException.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace Illuminate\Contracts\View;
+
+use Exception;
+
+class ViewCompilationException extends Exception
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/illuminate/contracts/composer.json b/data/web/inc/lib/vendor/illuminate/contracts/composer.json
index 9296ba9e..acae4bef 100644
--- a/data/web/inc/lib/vendor/illuminate/contracts/composer.json
+++ b/data/web/inc/lib/vendor/illuminate/contracts/composer.json
@@ -14,7 +14,7 @@
}
],
"require": {
- "php": "^8.0.2",
+ "php": "^8.1",
"psr/container": "^1.1.1|^2.0.1",
"psr/simple-cache": "^1.0|^2.0|^3.0"
},
@@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "9.x-dev"
+ "dev-master": "10.x-dev"
}
},
"config": {
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/.phpstorm.meta.php b/data/web/inc/lib/vendor/nesbot/carbon/.phpstorm.meta.php
new file mode 100644
index 00000000..bd7c7e0e
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/.phpstorm.meta.php
@@ -0,0 +1,10 @@
+<?php
+namespace PHPSTORM_META {
+ registerArgumentsSet("date_units", "millenania", "millennium", "century", "centuries", "decade", "decades", "year", "years", "y", "yr", "yrs", "quarter", "quarters", "month", "months", "mo", "mos", "week", "weeks", "w", "day", "days", "d", "hour", "hours", "h", "minute", "minutes", "m", "second", "seconds", "s", "millisecond", "milliseconds", "milli", "ms", "microsecond", "microseconds", "micro", "µs");
+ expectedArguments(\Carbon\Traits\Units::add(), 0, argumentsSet("date_units"));
+ expectedArguments(\Carbon\Traits\Units::add(), 1, argumentsSet("date_units"));
+ expectedArguments(\Carbon\CarbonInterface::add(), 0, argumentsSet("date_units"));
+ expectedArguments(\Carbon\CarbonInterface::add(), 1, argumentsSet("date_units"));
+
+ expectedArguments(\Carbon\CarbonInterface::getTimeFormatByPrecision(), 0, "minute", "second", "m", "millisecond", "µ", "microsecond", "minutes", "seconds", "ms", "milliseconds", "µs", "microseconds");
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/composer.json b/data/web/inc/lib/vendor/nesbot/carbon/composer.json
index 84ec1361..48366b5d 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/composer.json
+++ b/data/web/inc/lib/vendor/nesbot/carbon/composer.json
@@ -1,14 +1,13 @@
{
"name": "nesbot/carbon",
- "type": "library",
"description": "An API extension for DateTime that supports 281 different languages.",
+ "license": "MIT",
+ "type": "library",
"keywords": [
"date",
"time",
"DateTime"
],
- "homepage": "https://carbon.nesbot.com",
- "license": "MIT",
"authors": [
{
"name": "Brian Nesbitt",
@@ -20,30 +19,76 @@
"homepage": "https://github.com/kylekatarnls"
}
],
+ "homepage": "https://carbon.nesbot.com",
+ "support": {
+ "issues": "https://github.com/briannesbitt/Carbon/issues",
+ "source": "https://github.com/briannesbitt/Carbon",
+ "docs": "https://carbon.nesbot.com/docs"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/kylekatarnls",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme",
+ "type": "tidelift"
+ },
+ {
+ "url": "https://opencollective.com/Carbon#sponsor",
+ "type": "opencollective"
+ }
+ ],
"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.0",
- "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": "*",
"phpmd/phpmd": "^2.9",
"phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^0.12.54 || ^1.0",
- "phpunit/phpunit": "^7.5.20 || ^8.5.14",
+ "phpstan/phpstan": "^0.12.99 || ^1.7.14",
+ "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6",
+ "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": {
+ "psr-4": {
+ "Carbon\\": "src/Carbon/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Tests\\": "tests/"
+ },
+ "files": [
+ "tests/Laravel/ServiceProvider.php"
+ ]
+ },
+ "bin": [
+ "bin/carbon"
+ ],
"config": {
- "process-timeout": 0,
- "sort-packages": true,
"allow-plugins": {
- "phpstan/extension-installer": true
- }
+ "phpstan/extension-installer": true,
+ "composer/package-versions-deprecated": true
+ },
+ "process-timeout": 0,
+ "sort-packages": true
},
"extra": {
"branch-alias": {
@@ -61,28 +106,11 @@
]
}
},
- "autoload": {
- "psr-4": {
- "Carbon\\": "src/Carbon/"
- }
- },
- "autoload-dev": {
- "psr-4": {
- "Tests\\": "tests/"
- },
- "files": [
- "tests/Laravel/ServiceProvider.php"
- ]
- },
- "minimum-stability": "dev",
- "prefer-stable": true,
- "bin": [
- "bin/carbon"
- ],
"scripts": {
"phpcs": "php-cs-fixer fix -v --diff --dry-run",
"phpdoc": "php phpdoc.php",
"phpmd": "phpmd src text /phpmd.xml",
+ "phpmd-test": "phpmd tests text /tests/phpmd-test.xml",
"phpstan": "phpstan analyse --configuration phpstan.neon",
"phpunit": "phpunit --verbose",
"style-check": [
@@ -93,11 +121,7 @@
"test": [
"@phpunit",
"@style-check"
- ]
- },
- "support": {
- "issues": "https://github.com/briannesbitt/Carbon/issues",
- "source": "https://github.com/briannesbitt/Carbon",
- "docs": "https://carbon.nesbot.com/docs"
+ ],
+ "sponsors": "php sponsors.php"
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php
new file mode 100644
index 00000000..c2f4bf01
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php
@@ -0,0 +1,28 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\MessageFormatter;
+
+use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
+
+if (!class_exists(LazyMessageFormatter::class, false)) {
+ abstract class LazyMessageFormatter implements MessageFormatterInterface
+ {
+ public function format(string $message, string $locale, array $parameters = []): string
+ {
+ return $this->formatter->format(
+ $message,
+ $this->transformLocale($locale),
+ $parameters
+ );
+ }
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php
new file mode 100644
index 00000000..cbd890d5
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\MessageFormatter;
+
+use Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface;
+use Symfony\Component\Translation\Formatter\MessageFormatterInterface;
+
+if (!class_exists(LazyMessageFormatter::class, false)) {
+ abstract class LazyMessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface
+ {
+ abstract protected function transformLocale(?string $locale): ?string;
+
+ public function format($message, $locale, array $parameters = [])
+ {
+ return $this->formatter->format(
+ $message,
+ $this->transformLocale($locale),
+ $parameters
+ );
+ }
+
+ public function choiceFormat($message, $number, $locale, array $parameters = [])
+ {
+ return $this->formatter->choiceFormat($message, $number, $locale, $parameters);
+ }
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php
new file mode 100644
index 00000000..ba7cf632
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroBuiltin.php
@@ -0,0 +1,36 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\PHPStan;
+
+use PHPStan\BetterReflection\Reflection;
+use ReflectionMethod;
+
+if (!class_exists(AbstractReflectionMacro::class, false)) {
+ abstract class AbstractReflectionMacro extends AbstractMacro
+ {
+ /**
+ * {@inheritdoc}
+ */
+ public function getReflection(): ?ReflectionMethod
+ {
+ if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) {
+ return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction);
+ }
+
+ return $this->reflectionFunction instanceof ReflectionMethod
+ ? $this->reflectionFunction
+ : null;
+ }
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php
new file mode 100644
index 00000000..bd4c8e80
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/AbstractMacroStatic.php
@@ -0,0 +1,45 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\PHPStan;
+
+use PHPStan\BetterReflection\Reflection;
+use ReflectionMethod;
+
+if (!class_exists(AbstractReflectionMacro::class, false)) {
+ abstract class AbstractReflectionMacro extends AbstractMacro
+ {
+ /**
+ * {@inheritdoc}
+ */
+ public function getReflection(): ?Reflection\Adapter\ReflectionMethod
+ {
+ if ($this->reflectionFunction instanceof Reflection\Adapter\ReflectionMethod) {
+ return $this->reflectionFunction;
+ }
+
+ if ($this->reflectionFunction instanceof Reflection\ReflectionMethod) {
+ return new Reflection\Adapter\ReflectionMethod($this->reflectionFunction);
+ }
+
+ return $this->reflectionFunction instanceof ReflectionMethod
+ ? new Reflection\Adapter\ReflectionMethod(
+ Reflection\ReflectionMethod::createFromName(
+ $this->reflectionFunction->getDeclaringClass()->getName(),
+ $this->reflectionFunction->getName()
+ )
+ )
+ : null;
+ }
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php
index eacd9c1e..f615b3a6 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php
@@ -14,14 +14,16 @@ declare(strict_types=1);
namespace Carbon\PHPStan;
if (!class_exists(LazyMacro::class, false)) {
- abstract class LazyMacro extends AbstractMacro
+ abstract class LazyMacro extends AbstractReflectionMacro
{
/**
* {@inheritdoc}
*/
public function getFileName(): ?string
{
- return $this->reflectionFunction->getFileName();
+ $file = $this->reflectionFunction->getFileName();
+
+ return (($file ? realpath($file) : null) ?: $file) ?: null;
}
/**
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php
index 3e9fcf4f..bf64c1dd 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php
@@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Carbon\PHPStan;
if (!class_exists(LazyMacro::class, false)) {
- abstract class LazyMacro extends AbstractMacro
+ abstract class LazyMacro extends AbstractReflectionMacro
{
/**
* {@inheritdoc}
@@ -23,7 +23,9 @@ if (!class_exists(LazyMacro::class, false)) {
*/
public function getFileName()
{
- return $this->reflectionFunction->getFileName();
+ $file = $this->reflectionFunction->getFileName();
+
+ return (($file ? realpath($file) : null) ?: $file) ?: null;
}
/**
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/readme.md b/data/web/inc/lib/vendor/nesbot/carbon/readme.md
index 5d827219..3f411770 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/readme.md
+++ b/data/web/inc/lib/vendor/nesbot/carbon/readme.md
@@ -2,7 +2,7 @@
[](https://packagist.org/packages/nesbot/carbon)
[](https://packagist.org/packages/nesbot/carbon)
-[](https://actions-badge.atrox.dev/briannesbitt/Carbon/goto)
+[](https://github.com/briannesbitt/Carbon/actions)
[](https://codecov.io/github/briannesbitt/Carbon?branch=master)
[](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme)
@@ -119,21 +119,52 @@ 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.
-<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a>
-<a href="https://onlinecasinohex.ca/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img src="https://images.opencollective.com/hexcasinoca/2da3af2/logo/256.png" width="85" height="64"></a>
-<a href="https://opencollective.com/Carbon/sponsor/0/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/0/avatar.svg"></a>
-<a href="https://opencollective.com/Carbon/sponsor/1/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/1/avatar.svg"></a>
-<a href="https://opencollective.com/Carbon/sponsor/2/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/2/avatar.svg"></a>
-<a href="https://opencollective.com/Carbon/sponsor/3/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/3/avatar.svg"></a>
-<a href="https://opencollective.com/Carbon/sponsor/4/website" target="_blank"><img src="https://opencollective.com/Carbon/sponsor/4/avatar.svg"></a>
-
-[[Become a sponsor](https://opencollective.com/Carbon#sponsor)]
+<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a><!-- <open-collective-sponsors> -->
+<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="64" height="64"></a>
+<a title="#1 Guide To Online Gambling In Canada" href="https://casinohex.org/canada/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="CasinoHex Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/79fdbcc0-a997-11eb-abbc-25e48b63c6dc.jpg" width="85" height="64"></a>
+<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="89" height="64"></a>
+<a title="Gives a fun for our users" href="https://slotoking.ua/games/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Игровые автоматы" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
+<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="64" height="64"></a>
+<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
+<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="inkedin" src="https://logo.clearbit.com/inkedin.com" width="64" height="64"></a>
+<a title="Актуальний та повносправний рейтинг онлайн казино України, ґрунтований на відгуках реальних гравців." href="https://uk.onlinecasino.in.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино України" src="https://opencollective-production.s3.us-west-1.amazonaws.com/c0b4b090-eef8-11ec-9cb7-0527a205b226.png" width="64" height="64"></a>
+<a title="OnlineCasinosSpelen" href="https://onlinecasinosspelen.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="OnlineCasinosSpelen" src="https://logo.clearbit.com/onlinecasinosspelen.com" width="64" height="64"></a>
+<a title="Best non Gamstop sites in the UK" href="https://nongamstopcasinos.net/gb/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Best non Gamstop sites in the UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/34e340b8-e1de-4932-8a76-1b3ce2ec7ee8/logo_white%20bg%20(8).png" width="64" height="64"></a>
+<a title="Real Money Pokies" href="https://www.nzfirst.org.nz/real-money-pokies/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Real Money Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/30d38232-a9d6-4e95-a48c-641fdc4d96fd/NZ_logo%20(6)%20(1)%20(1).jpg" width="64" height="64"></a>
+<a title="Non GamStop Bookies UK" href="https://nongamstopbookies.com/uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Non GamStop Bookies UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/43c5561c-8907-4ef7-a4ee-c6da054788b8/logo-site%20(3).jpg" width="64" height="64"></a>
+<a title="Актуальний топ-рейтинг українських онлайн казино на гривні! Щоденне оновлення топу та унікальна система ранжування, основана на відгуках гравців!" href="https://onlinecasino.in.ua/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Онлайн Казино Украины" src="https://opencollective-production.s3.us-west-1.amazonaws.com/8fdd8aa0-e273-11ec-a95e-d38fd331cabf.png" width="64" height="64"></a>
+<a title="Twitter Video Downloader HD Tool allows you to store tweets on your device (mobile or PC) for free." href="https://ssstwitter.online/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="SSSTwitter" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/ba0d1daf-a894-4d98-95f7-a44d321364b3/Screenshot%202024-01-16%20at%2011.43.22.png" width="76" height="64"></a>
+<a title="Entertainment" href="https://www.nongamstopbets.com/casinos-not-on-gamstop/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Non-GamStop Bets UK" src="https://logo.clearbit.com/nongamstopbets.com" width="64" height="64"></a>
+<a title="Chudovo - international software development company with representative offices in Kyiv, Cologne, New York, Tallinn and London. It has been working on the market since 2006. Company has domain expertise in video security, logistics, medicine, finance and" href="https://chudovo.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Chudovo" src="https://opencollective-production.s3.us-west-1.amazonaws.com/326c19a0-2e87-11eb-a13a-c99a2a201d11.png" width="84" height="42"></a>
+<a title="Entertainment" href="https://casinogap.org/uk/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="UK Casino Gap" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/143f9301-beec-4118-89d5-9a07a01345f3/casinogap-uk.png" width="42" height="42"></a>
+<a title="NZ Gaming Portal" href="https://casinodeps.co.nz?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="NZ Casino Deps" src="https://logo.clearbit.com/casinodeps.co.nz" width="42" height="42"></a>
+<a title="NonStop Sites" href="https://uk.nonstopcasino.org/non-gamstop-casinos/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="NonStopCasino.org" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/fd7ad905-8752-468f-ad20-582a24cca9d9/non-stop-casino.png" width="42" height="42"></a>
+<a title="Siti Non AAMS" href="https://www.outlookindia.com/outlook-spotlight/migliori-siti-non-aams-siti-scommesse-senza-licenza-sicuri-news-294715?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Migliori Siti Non AAMS" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/392810da-6cb6-4938-a3cb-38bd0e1eb7de/migliori-siti-non-aams.png" width="42" height="42"></a>
+<a title="List of trusted non GamStop casino reviews" href="https://nongamstopcasinos.org?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="UK NonGamStopCasinos" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/cbda0ee1-26ea-4252-9580-f1f9b317b1f7/nongamstopcasinos-uk.png" width="42" height="42"></a>
+<a title="Online TikTok Video Download Tool" href="https://snaptik.pro?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="SnapTik" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/546bcd53-6615-457d-ab21-1db1c52b3af5/logo.jpg" width="42" height="42"></a>
+<a title="IG Downloader is an Instagram Downloader service that offers a variety of tools to download Instagram content for free. Listed below are all the tools" href="https://indownloader.app/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="IG Downloader" src="https://logo.clearbit.com/indownloader.app" width="42" height="42"></a>
+<a title="Proxidize is a mobile proxy creation and management platform that provides all needed components from hardware to cloud software and SIM cards." href="https://proxidize.com/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Proxidize" src="https://logo.clearbit.com/proxidize.com" width="42" height="42"></a>
+<a title="Blastup offers Instagram growth services like buying likes, views, and followers, emphasizing real user engagement and instant delivery." href="https://blastup.com/buy-instagram-likes?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Blastup" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/955a0beb-9fe8-4753-ad92-fae8ef5382fc/favicon--dark.jpg" width="42" height="42"></a>
+<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations." href="https://azuracast.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="42" height="42"></a>
+<a title="Triplebyte is the first software engineering job platform that is on the developer's side. Take our coding quiz!" href="https://triplebyte.com/os/opencollective?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Triplebyte" src="https://opencollective-production.s3.us-west-1.amazonaws.com/43e4f9d0-30cd-11ea-9c6b-e1142996e8b2.png" width="42" height="42"></a>
+<a title="Connect your Collective to GitHub Sponsors: https://docs.opencollective.com/help/collectives/github-sponsors" href="https://github.com/sponsors/?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="GitHub Sponsors" src="https://opencollective-production.s3.us-west-1.amazonaws.com/87b1d240-f617-11ea-9960-fd7e8ab20fe4.png" width="48" height="42"></a>
+<a title="Salesforce" href="https://engineering.salesforce.com?utm_source=opencollective&utm_medium=github&utm_campaign=Carbon" target="_blank"><img alt="Salesforce" src="https://opencollective-production.s3.us-west-1.amazonaws.com/24d34880-df8d-11e9-949c-6bc2037b6bd5.png" width="42" height="42"></a>
+<!-- </open-collective-sponsors> -->
+
+[[Become a sponsor via OpenCollective](https://opencollective.com/Carbon#sponsor)]
+
+<a href="https://github.com/johnrsimeone" target="_blank"><img src="https://avatars.githubusercontent.com/u/22871068?s=70&v=4" width="64" height="64"></a>
+<a href="https://github.com/taylorotwell" target="_blank"><img src="https://avatars.githubusercontent.com/u/463230?s=128&v=4" width="64" height="64"></a>
+<a href="https://github.com/getsentry" target="_blank"><img src="https://avatars.githubusercontent.com/u/1396951?s=128&v=4" width="64" height="64"></a>
+<a href="https://github.com/codecov" target="_blank"><img src="https://avatars.githubusercontent.com/u/8226205?s=128&v=4" width="64" height="64"></a>
+
+[[Become a sponsor via GitHub](https://github.com/sponsors/kylekatarnls)]
### Backers
Thank you to all our backers! 🙏
-<a href="https://opencollective.com/Carbon#backers" target="_blank"><img src="https://opencollective.com/Carbon/backers.svg?width=890"></a>
+<a href="https://opencollective.com/Carbon#backers" target="_blank"><img src="https://opencollective.com/Carbon/backers.svg?width=890&version=2023-06-08-07-12"></a>
[[Become a backer](https://opencollective.com/Carbon#backer)]
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/sponsors.php b/data/web/inc/lib/vendor/nesbot/carbon/sponsors.php
new file mode 100644
index 00000000..67b21716
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/sponsors.php
@@ -0,0 +1,129 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * 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".'<a title="'.$title.'" href="'.$href.'" target="_blank">'.
+ '<img alt="'.$alt.'" src="'.$src.'" width="'.$width.'" height="'.$height.'">'.
+ '</a>';
+ }, $list))."\n";
+}
+
+file_put_contents('readme.md', preg_replace_callback(
+ '/(<!-- <open-collective-sponsors> -->)[\s\S]+(<!-- <\/open-collective-sponsors> -->)/',
+ static function (array $match): string {
+ return $match[1].getOpenCollectiveSponsors().$match[2];
+ },
+ file_get_contents('readme.md')
+));
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php
index 48441e7c..8b8fe089 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php
@@ -11,6 +11,7 @@
namespace Carbon;
+use Carbon\MessageFormatter\MessageFormatterMapper;
use Closure;
use ReflectionException;
use ReflectionFunction;
@@ -51,7 +52,7 @@ abstract class AbstractTranslator extends Translation\Translator
/**
* List of locales aliases.
*
- * @var string[]
+ * @var array<string, string>
*/
protected $aliases = [
'me' => 'sr_Latn_ME',
@@ -83,7 +84,7 @@ abstract class AbstractTranslator extends Translation\Translator
$this->initializing = true;
$this->directories = [__DIR__.'/Lang'];
$this->addLoader('array', new ArrayLoader());
- parent::__construct($locale, $formatter, $cacheDir, $debug);
+ parent::__construct($locale, new MessageFormatterMapper($formatter), $cacheDir, $debug);
$this->initializing = false;
}
@@ -220,8 +221,8 @@ abstract class AbstractTranslator extends Translation\Translator
$catalogue = $this->getCatalogue($locale);
$format = $this instanceof TranslatorStrongTypeInterface
- ? $this->getFromCatalogue($catalogue, (string) $id, $domain) // @codeCoverageIgnore
- : $this->getCatalogue($locale)->get((string) $id, $domain);
+ ? $this->getFromCatalogue($catalogue, (string) $id, $domain)
+ : $this->getCatalogue($locale)->get((string) $id, $domain); // @codeCoverageIgnore
if ($format instanceof Closure) {
// @codeCoverageIgnoreStart
@@ -250,11 +251,7 @@ abstract class AbstractTranslator extends Translation\Translator
*/
protected function loadMessagesFromFile($locale)
{
- if (isset($this->messages[$locale])) {
- return true;
- }
-
- return $this->resetMessages($locale);
+ return isset($this->messages[$locale]) || $this->resetMessages($locale);
}
/**
@@ -311,7 +308,7 @@ abstract class AbstractTranslator extends Translation\Translator
*/
public function setLocale($locale)
{
- $locale = preg_replace_callback('/[-_]([a-z]{2,}|[0-9]{2,})/', function ($matches) {
+ $locale = preg_replace_callback('/[-_]([a-z]{2,}|\d{2,})/', function ($matches) {
// _2-letters or YUE is a region, _3+-letters is a variant
$upper = strtoupper($matches[1]);
@@ -359,13 +356,13 @@ abstract class AbstractTranslator extends Translation\Translator
parent::setLocale($macroLocale);
}
- if ($this->loadMessagesFromFile($locale) || $this->initializing) {
- parent::setLocale($locale);
-
- return true;
+ if (!$this->loadMessagesFromFile($locale) && !$this->initializing) {
+ return false;
}
- return false;
+ parent::setLocale($locale);
+
+ return true;
}
/**
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php
index e327590e..e32569ae 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Carbon.php
@@ -33,477 +33,477 @@ use DateTimeZone;
* @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 Carbon|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 Carbon __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
*
* </autodoc>
*/
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php
index 6d1194ee..4c9c1cfe 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php
@@ -24,486 +24,486 @@ use DateTimeZone;
*
* <autodoc generated by `composer phpdoc`>
*
- * @property int $year
- * @property int $yearIso
- * @property int $month
- * @property int $day
- * @property int $hour
- * @property int $minute
- * @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 $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 $year
+ * @property int $yearIso
+ * @property int $month
+ * @property int $day
+ * @property int $hour
+ * @property int $minute
+ * @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 $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
*
- * @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 CarbonImmutable|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 CarbonImmutable __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
*
* </autodoc>
*/
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php
index 15e2061c..b90e2981 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php
@@ -586,6 +586,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
public const YEARS_PER_DECADE = 10;
public const MONTHS_PER_YEAR = 12;
public const MONTHS_PER_QUARTER = 3;
+ public const QUARTERS_PER_YEAR = 4;
public const WEEKS_PER_YEAR = 52;
public const WEEKS_PER_MONTH = 4;
public const DAYS_PER_YEAR = 365;
@@ -726,6 +727,8 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
/**
* Returns the list of properties to dump on serialize() called on.
*
+ * Only used by PHP < 7.4.
+ *
* @return array
*/
public function __sleep();
@@ -735,7 +738,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* @example
* ```
- * echo Carbon::now(); // Carbon instances can be casted to string
+ * echo Carbon::now(); // Carbon instances can be cast to string
* ```
*
* @return string
@@ -987,7 +990,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* @param string $modifier
*
- * @return static
+ * @return static|false
*/
public function change($modifier);
@@ -1038,13 +1041,13 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
* 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
*
@@ -1276,7 +1279,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* @return CarbonInterval
*/
- public function diffAsCarbonInterval($date = null, $absolute = true);
+ public function diffAsCarbonInterval($date = null, $absolute = true, array $skip = []);
/**
* Get the difference by the given interval using a filter closure.
@@ -2116,6 +2119,18 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*/
public static function getDays();
+ /**
+ * Return the number of days since the start of the week (using the current locale or the first parameter
+ * if explicitly given).
+ *
+ * @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week,
+ * if not provided, start of week is inferred from the locale
+ * (Sunday for en_US, Monday for de_DE, etc.)
+ *
+ * @return int
+ */
+ public function getDaysFromStartOfWeek(?int $weekStartsAt = null): int;
+
/**
* Get the fallback locale.
*
@@ -2738,12 +2753,35 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
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')->isLongYear(); // true
- * Carbon::parse('2016-01-01')->isLongYear(); // false
+ * 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::create(2015)->isLongYear(); // true
+ * Carbon::create(2016)->isLongYear(); // false
* ```
*
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
@@ -3382,7 +3420,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* @param string|int|null $modifier
*
- * @return static
+ * @return static|false
*/
public function next($modifier = null);
@@ -3528,7 +3566,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* @param string|int|null $modifier
*
- * @return static
+ * @return static|false
*/
public function previous($modifier = null);
@@ -3773,6 +3811,19 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*/
public function setDateTimeFrom($date = null);
+ /**
+ * Set the day (keeping the current time) to the start of the week + the number of days passed as the first
+ * parameter. First day of week is driven by the locale unless explicitly set with the second parameter.
+ *
+ * @param int $numberOfDays number of days to add after the start of the current week
+ * @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week,
+ * if not provided, start of week is inferred from the locale
+ * (Sunday for en_US, Monday for de_DE, etc.)
+ *
+ * @return static
+ */
+ public function setDaysFromStartOfWeek(int $numberOfDays, ?int $weekStartsAt = null);
+
/**
* Set the fallback locale.
*
@@ -3860,7 +3911,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* /!\ Use this method for unit tests only.
*
- * @param Closure|static|string|false|null $testNow real or mock Carbon instance
+ * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
*/
public static function setTestNow($testNow = null);
@@ -3881,7 +3932,7 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* /!\ Use this method for unit tests only.
*
- * @param Closure|static|string|false|null $testNow real or mock Carbon instance
+ * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
*/
public static function setTestNowAndTimezone($testNow = null, $tz = null);
@@ -3942,11 +3993,11 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
/**
* @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
- * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
- * use other method or custom format passed to format() method if you need to dump an other string
+ * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
+ * use other method or custom format passed to format() method if you need to dump another string
* format.
*
- * Set the default format used when type juggling a Carbon instance to a string
+ * Set the default format used when type juggling a Carbon instance to a string.
*
* @param string|Closure|null $format
*
@@ -4537,6 +4588,18 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*/
public function toFormattedDateString();
+ /**
+ * Format the instance with the day, and a readable date
+ *
+ * @example
+ * ```
+ * echo Carbon::now()->toFormattedDayDateString();
+ * ```
+ *
+ * @return string
+ */
+ public function toFormattedDayDateString(): string;
+
/**
* Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept:
* 1977-04-22T01:00:00-05:00).
@@ -5057,12 +5120,14 @@ interface CarbonInterface extends DateTimeInterface, JsonSerializable
*
* /!\ Use this method for unit tests only.
*
- * @param Closure|static|string|false|null $testNow real or mock Carbon instance
- * @param Closure|null $callback
+ * @template T
*
- * @return mixed
+ * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
+ * @param Closure(): T $callback
+ *
+ * @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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
index d465beac..8437c545 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
@@ -15,6 +15,7 @@ use Carbon\Exceptions\BadFluentConstructorException;
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;
@@ -22,15 +23,20 @@ use Carbon\Exceptions\UnknownSetterException;
use Carbon\Exceptions\UnknownUnitException;
use Carbon\Traits\IntervalRounding;
use Carbon\Traits\IntervalStep;
+use Carbon\Traits\MagicParameter;
use Carbon\Traits\Mixin;
use Carbon\Traits\Options;
+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;
/**
@@ -46,7 +52,7 @@ use Throwable;
* @property int $minutes Total minutes of the current interval.
* @property int $seconds Total seconds of the current interval.
* @property int $microseconds Total microseconds of the current interval.
- * @property int $milliseconds Total microseconds of the current interval.
+ * @property int $milliseconds Total milliseconds of the current interval.
* @property int $microExcludeMilli Remaining microseconds without the milliseconds.
* @property int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7).
* @property int $daysExcludeWeeks alias of dayzExcludeWeeks
@@ -184,10 +190,12 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
{
use IntervalRounding;
use IntervalStep;
+ use MagicParameter;
use Mixin {
Mixin::mixin as baseMixin;
}
use Options;
+ use ToStringFormat;
/**
* Interval spec period designators
@@ -241,6 +249,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*/
private static $flipCascadeFactors;
+ /**
+ * @var bool
+ */
+ private static $floatSettersEnabled = false;
+
/**
* The registered macros.
*
@@ -294,7 +307,12 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*/
public static function getCascadeFactors()
{
- return static::$cascadeFactors ?: [
+ return static::$cascadeFactors ?: static::getDefaultCascadeFactors();
+ }
+
+ protected static function getDefaultCascadeFactors(): array
+ {
+ return [
'milliseconds' => [Carbon::MICROSECONDS_PER_MILLISECOND, 'microseconds'],
'seconds' => [Carbon::MILLISECONDS_PER_SECOND, 'milliseconds'],
'minutes' => [Carbon::SECONDS_PER_MINUTE, 'seconds'],
@@ -337,6 +355,19 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
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 /////////////////////////
///////////////////////////////////////////////////////////////////
@@ -344,14 +375,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Create a new CarbonInterval instance.
*
- * @param 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 Closure|DateInterval|string|int|null $years
+ * @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.
*/
@@ -371,8 +402,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
$spec = $years;
+ $isStringSpec = (\is_string($spec) && !preg_match('/^[\d.]/', $spec));
- if (!\is_string($spec) || (float) $years || preg_match('/^[0-9.]/', $years)) {
+ if (!$isStringSpec || (float) $years) {
$spec = static::PERIOD_PREFIX;
$spec .= $years > 0 ? $years.static::PERIOD_YEARS : '';
@@ -397,7 +429,74 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
}
- parent::__construct($spec);
+ try {
+ parent::__construct($spec);
+ } catch (Throwable $exception) {
+ try {
+ parent::__construct('PT0S');
+
+ if ($isStringSpec) {
+ if (!preg_match('/^P
+ (?:(?<year>[+-]?\d*(?:\.\d+)?)Y)?
+ (?:(?<month>[+-]?\d*(?:\.\d+)?)M)?
+ (?:(?<week>[+-]?\d*(?:\.\d+)?)W)?
+ (?:(?<day>[+-]?\d*(?:\.\d+)?)D)?
+ (?:T
+ (?:(?<hour>[+-]?\d*(?:\.\d+)?)H)?
+ (?:(?<minute>[+-]?\d*(?:\.\d+)?)M)?
+ (?:(?<second>[+-]?\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;
@@ -410,7 +509,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
* @param string $source
* @param string $target
*
- * @return int|null
+ * @return int|float|null
*/
public static function getFactor($source, $target)
{
@@ -438,7 +537,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
* @param string $source
* @param string $target
*
- * @return int|null
+ * @return int|float|null
*/
public static function getFactorWithDefault($source, $target)
{
@@ -465,7 +564,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Returns current config for days per week.
*
- * @return int
+ * @return int|float
*/
public static function getDaysPerWeek()
{
@@ -475,7 +574,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Returns current config for hours per day.
*
- * @return int
+ * @return int|float
*/
public static function getHoursPerDay()
{
@@ -485,7 +584,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Returns current config for minutes per hour.
*
- * @return int
+ * @return int|float
*/
public static function getMinutesPerHour()
{
@@ -495,7 +594,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Returns current config for seconds per minute.
*
- * @return int
+ * @return int|float
*/
public static function getSecondsPerMinute()
{
@@ -505,7 +604,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Returns current config for microseconds per second.
*
- * @return int
+ * @return int|float
*/
public static function getMillisecondsPerSecond()
{
@@ -515,7 +614,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Returns current config for microseconds per second.
*
- * @return int
+ * @return int|float
*/
public static function getMicrosecondsPerMillisecond()
{
@@ -673,6 +772,23 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
}
+ /**
+ * 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.
*
@@ -767,6 +883,8 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
case 'year':
case 'years':
case 'y':
+ case 'yr':
+ case 'yrs':
$years += $intValue;
break;
@@ -780,6 +898,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
case 'month':
case 'months':
case 'mo':
+ case 'mos':
$months += $intValue;
break;
@@ -882,7 +1001,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
return static::fromString(Carbon::translateTimeString($interval, $locale ?: static::getLocale(), 'en'));
}
- private static function castIntervalToClass(DateInterval $interval, string $className)
+ private static function castIntervalToClass(DateInterval $interval, string $className, array $skip = [])
{
$mainClass = DateInterval::class;
@@ -891,7 +1010,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
$microseconds = $interval->f;
- $instance = new $className(static::getDateIntervalSpec($interval));
+ $instance = new $className(static::getDateIntervalSpec($interval, false, $skip));
if ($microseconds) {
$instance->f = $microseconds;
@@ -940,12 +1059,19 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
* 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)
+ public static function instance(DateInterval $interval, array $skip = [], bool $skipCopy = false)
{
- return self::castIntervalToClass($interval, static::class);
+ if ($skipCopy && $interval instanceof static) {
+ return $interval;
+ }
+
+ return self::castIntervalToClass($interval, static::class, $skip);
}
/**
@@ -956,17 +1082,20 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*
* @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) {
@@ -984,7 +1113,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
{
$interval = preg_replace('/\s+/', ' ', trim($interval));
- if (preg_match('/^P[T0-9]/', $interval)) {
+ if (preg_match('/^P[T\d]/', $interval)) {
return new static($interval);
}
@@ -992,8 +1121,14 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
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;
}
@@ -1081,11 +1216,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
return (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND) % Carbon::MICROSECONDS_PER_MILLISECOND;
case 'weeks':
- return (int) ($this->d / static::getDaysPerWeek());
+ return (int) ($this->d / (int) static::getDaysPerWeek());
case 'daysExcludeWeeks':
case 'dayzExcludeWeeks':
- return $this->d % static::getDaysPerWeek();
+ return $this->d % (int) static::getDaysPerWeek();
case 'locale':
return $this->getTranslatorLocale();
@@ -1126,43 +1261,63 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
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 * 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 * 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;
@@ -1355,11 +1510,15 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
if (preg_match('/^(?<method>add|sub)(?<unit>[A-Z].*)$/', $method, $match)) {
- return $this->{$match['method']}($parameters[0], $match['unit']);
+ $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($match['unit']), 0);
+
+ return $this->{$match['method']}($value, $match['unit']);
}
+ $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($method), 1);
+
try {
- $this->set($method, \count($parameters) === 0 ? 1 : $parameters[0]);
+ $this->set($method, $value);
} catch (UnknownSetterException $exception) {
if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) {
throw new BadFluentSetterException($method, 0, $exception);
@@ -1410,9 +1569,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
$minimumUnit = 's';
$skip = [];
extract($this->getForHumansInitialVariables($syntax, $short));
- $skip = array_filter((array) $skip, static function ($value) {
+ $skip = array_map('strtolower', array_filter((array) $skip, static function ($value) {
return \is_string($value) && $value !== '';
- });
+ }));
if ($syntax === null) {
$syntax = CarbonInterface::DIFF_ABSOLUTE;
@@ -1435,11 +1594,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
];
}
- if ($altNumbers) {
- if ($altNumbers !== true) {
- $language = new Language($this->locale);
- $altNumbers = \in_array($language->getCode(), (array) $altNumbers);
- }
+ if ($altNumbers && $altNumbers !== true) {
+ $language = new Language($this->locale);
+ $altNumbers = \in_array($language->getCode(), (array) $altNumbers, true);
}
if (\is_array($join)) {
@@ -1620,18 +1777,23 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
$unit = $short ? 's' : 'second';
$isFuture = $this->invert === 1;
$transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before');
+ $declensionMode = null;
/** @var \Symfony\Component\Translation\Translator $translator */
$translator = $this->getLocalTranslator();
- $handleDeclensions = function ($unit, $count) use ($interpolations, $transId, $translator, $altNumbers, $absolute) {
+ $handleDeclensions = function ($unit, $count, $index = 0, $parts = 1) use ($interpolations, $transId, $translator, $altNumbers, $absolute, &$declensionMode) {
if (!$absolute) {
- // Some languages have special pluralization for past and future tense.
- $key = $unit.'_'.$transId;
- $result = $this->translate($key, $interpolations, $count, $translator, $altNumbers);
+ $declensionMode = $declensionMode ?? $this->translate($transId.'_mode');
- if ($result !== $key) {
- return $result;
+ if ($this->needsDeclension($declensionMode, $index, $parts)) {
+ // Some languages have special pluralization for past and future tense.
+ $key = $unit.'_'.$transId;
+ $result = $this->translate($key, $interpolations, $count, $translator, $altNumbers);
+
+ if ($result !== $key) {
+ return $result;
+ }
}
}
@@ -1696,17 +1858,17 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
}
- $transChoice = function ($short, $unitData) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) {
+ $transChoice = function ($short, $unitData, $index, $parts) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) {
$count = $unitData['value'];
if ($short) {
- $result = $handleDeclensions($unitData['unitShort'], $count);
+ $result = $handleDeclensions($unitData['unitShort'], $count, $index, $parts);
if ($result !== null) {
return $result;
}
} elseif ($aUnit) {
- $result = $handleDeclensions('a_'.$unitData['unit'], $count);
+ $result = $handleDeclensions('a_'.$unitData['unit'], $count, $index, $parts);
if ($result !== null) {
return $result;
@@ -1714,7 +1876,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
if (!$absolute) {
- return $handleDeclensions($unitData['unit'], $count);
+ return $handleDeclensions($unitData['unit'], $count, $index, $parts);
}
return $this->translate($unitData['unit'], $interpolations, $count, $translator, $altNumbers);
@@ -1726,7 +1888,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
if ($diffIntervalData['value'] > 0) {
$unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit'];
$count = $diffIntervalData['value'];
- $interval[] = $transChoice($short, $diffIntervalData);
+ $interval[] = [$short, $diffIntervalData];
} elseif ($options & CarbonInterface::SEQUENTIAL_PARTS_ONLY && \count($interval) > 0) {
break;
}
@@ -1737,13 +1899,19 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
// break the loop after we have reached the minimum unit
- if (\in_array($minimumUnit, [$diffIntervalData['unit'], $diffIntervalData['unitShort']])) {
+ if (\in_array($minimumUnit, [$diffIntervalData['unit'], $diffIntervalData['unitShort']], true)) {
$fallbackUnit = [$diffIntervalData['unit'], $diffIntervalData['unitShort']];
break;
}
}
+ $actualParts = \count($interval);
+
+ foreach ($interval as $index => &$item) {
+ $item = $transChoice($item[0], $item[1], $index, $actualParts);
+ }
+
if (\count($interval) === 0) {
if ($relativeToNow && $options & CarbonInterface::JUST_NOW) {
$key = 'diff_now';
@@ -1812,17 +1980,17 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*/
public function __toString()
{
- $format = $this->localToStringFormat;
+ $format = $this->localToStringFormat ?? static::$toStringFormat;
- if ($format) {
- if ($format instanceof Closure) {
- return $format($this);
- }
+ if (!$format) {
+ return $this->forHumans();
+ }
- return $this->format($format);
+ if ($format instanceof Closure) {
+ return $format($this);
}
- return $this->forHumans();
+ return $this->format($format);
}
/**
@@ -1863,7 +2031,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
/**
* Invert the interval.
*
- * @param bool|int $inverted if a parameter is passed, the passed value casted as 1 or 0 is used
+ * @param bool|int $inverted if a parameter is passed, the passed value cast as 1 or 0 is used
* as the new value of the ->invert property.
*
* @return $this
@@ -2141,7 +2309,7 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*
* @return string
*/
- public static function getDateIntervalSpec(DateInterval $interval)
+ public static function getDateIntervalSpec(DateInterval $interval, bool $microseconds = false, array $skip = [])
{
$date = array_filter([
static::PERIOD_YEARS => abs($interval->y),
@@ -2149,10 +2317,25 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
static::PERIOD_DAYS => abs($interval->d),
]);
+ if (
+ $interval->days >= CarbonInterface::DAYS_PER_WEEK * CarbonInterface::WEEKS_PER_MONTH &&
+ (!isset($date[static::PERIOD_YEARS]) || \count(array_intersect(['y', 'year', 'years'], $skip))) &&
+ (!isset($date[static::PERIOD_MONTHS]) || \count(array_intersect(['m', 'month', 'months'], $skip)))
+ ) {
+ $date = [
+ static::PERIOD_DAYS => abs($interval->days),
+ ];
+ }
+
+ $seconds = abs($interval->s);
+ if ($microseconds && $interval->f > 0) {
+ $seconds = sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000);
+ }
+
$time = array_filter([
static::PERIOD_HOURS => abs($interval->h),
static::PERIOD_MINUTES => abs($interval->i),
- static::PERIOD_SECONDS => abs($interval->s),
+ static::PERIOD_SECONDS => $seconds,
]);
$specString = static::PERIOD_PREFIX;
@@ -2176,9 +2359,9 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*
* @return string
*/
- public function spec()
+ public function spec(bool $microseconds = false)
{
- return static::getDateIntervalSpec($this);
+ return static::getDateIntervalSpec($this, $microseconds);
}
/**
@@ -2229,9 +2412,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
$originalData = $this->toArray();
$originalData['milliseconds'] = (int) ($originalData['microseconds'] / static::getMicrosecondsPerMillisecond());
$originalData['microseconds'] = $originalData['microseconds'] % static::getMicrosecondsPerMillisecond();
- $originalData['daysExcludeWeeks'] = $originalData['days'];
+ $originalData['weeks'] = (int) ($this->d / static::getDaysPerWeek());
+ $originalData['daysExcludeWeeks'] = fmod($this->d, static::getDaysPerWeek());
unset($originalData['days']);
$newData = $originalData;
+ $previous = [];
foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) {
foreach (['source', 'target'] as $key) {
@@ -2241,9 +2426,29 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
$value = $newData[$source];
- $modulo = ($factor + ($value % $factor)) % $factor;
+ $modulo = fmod($factor + fmod($value, $factor), $factor);
$newData[$source] = $modulo;
$newData[$target] += ($value - $modulo) / $factor;
+
+ $decimalPart = fmod($newData[$source], 1);
+
+ if ($decimalPart !== 0.0) {
+ $unit = $source;
+
+ foreach ($previous as [$subUnit, $subFactor]) {
+ $newData[$unit] -= $decimalPart;
+ $newData[$subUnit] += $decimalPart * $subFactor;
+ $decimalPart = fmod($newData[$subUnit], 1);
+
+ if ($decimalPart === 0.0) {
+ break;
+ }
+
+ $unit = $subUnit;
+ }
+ }
+
+ array_unshift($previous, [$source, $factor]);
}
$positive = null;
@@ -2324,13 +2529,13 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
$cumulativeFactor = 0;
$unitFound = false;
$factors = self::getFlipCascadeFactors();
- $daysPerWeek = static::getDaysPerWeek();
+ $daysPerWeek = (int) static::getDaysPerWeek();
$values = [
'years' => $this->years,
'months' => $this->months,
'weeks' => (int) ($this->d / $daysPerWeek),
- 'dayz' => $this->d % $daysPerWeek,
+ 'dayz' => fmod($this->d, $daysPerWeek),
'hours' => $this->hours,
'minutes' => $this->minutes,
'seconds' => $this->seconds,
@@ -2391,10 +2596,11 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
}
if ($unit === 'weeks') {
- return $result / $daysPerWeek;
+ $result /= $daysPerWeek;
}
- return $result;
+ // Cast as int numbers with no decimal part
+ return fmod($result, 1) === 0.0 ? (int) $result : $result;
}
/**
@@ -2662,6 +2868,15 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
*/
public function roundUnit($unit, $precision = 1, $function = 'round')
{
+ if (static::getCascadeFactors() !== static::getDefaultCascadeFactors()) {
+ $value = $function($this->total($unit) / $precision) * $precision;
+ $inverted = $value < 0;
+
+ return $this->copyProperties(self::fromString(
+ number_format(abs($value), 12, '.', '').' '.$unit
+ )->invert($inverted)->cascade());
+ }
+
$base = CarbonImmutable::parse('2000-01-01 00:00:00', 'UTC')
->roundUnit($unit, $precision, $function);
$next = $base->add($this);
@@ -2752,4 +2967,88 @@ class CarbonInterval extends DateInterval implements CarbonConverterInterface
{
return $this->round($precision, 'ceil');
}
+
+ private function needsDeclension(string $mode, int $index, int $parts): bool
+ {
+ switch ($mode) {
+ case 'last':
+ return $index === $parts - 1;
+ default:
+ 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php
index 0e81e757..d12a9869 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php
@@ -11,6 +11,7 @@
namespace Carbon;
+use Carbon\Exceptions\EndLessPeriodException;
use Carbon\Exceptions\InvalidCastException;
use Carbon\Exceptions\InvalidIntervalException;
use Carbon\Exceptions\InvalidPeriodDateException;
@@ -23,11 +24,13 @@ use Carbon\Exceptions\UnreachableException;
use Carbon\Traits\IntervalRounding;
use Carbon\Traits\Mixin;
use Carbon\Traits\Options;
+use Carbon\Traits\ToStringFormat;
use Closure;
use Countable;
use DateInterval;
use DatePeriod;
use DateTime;
+use DateTimeImmutable;
use DateTimeInterface;
use DateTimeZone;
use InvalidArgumentException;
@@ -48,43 +51,47 @@ use RuntimeException;
* @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.
@@ -173,6 +180,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
Mixin::mixin as baseMixin;
}
use Options;
+ use ToStringFormat;
/**
* Built-in filter for limit by recurrences.
@@ -230,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.
*
@@ -251,6 +266,13 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
protected $dateInterval;
+ /**
+ * True once __construct is finished.
+ *
+ * @var bool
+ */
+ protected $constructed = false;
+
/**
* Whether current date interval was set by default.
*
@@ -377,7 +399,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
);
}
- $class = \get_called_class();
+ $class = static::class;
$type = \gettype($period);
throw new NotAPeriodException(
@@ -482,15 +504,16 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
$interval = null;
$start = null;
$end = null;
+ $dateClass = static::DEFAULT_DATE_CLASS;
foreach (explode('/', $iso) as $key => $part) {
- if ($key === 0 && preg_match('/^R([0-9]*|INF)$/', $part, $match)) {
+ 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.");
@@ -503,7 +526,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
}
/**
- * 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
@@ -512,7 +535,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
protected static function addMissingParts($source, $target)
{
- $pattern = '/'.preg_replace('/[0-9]+/', '[0-9]+', preg_quote($target, '/')).'$/';
+ $pattern = '/'.preg_replace('/\d+/', '[0-9]+', preg_quote($target, '/')).'$/';
$result = preg_replace($pattern, $target, $source, 1, $count);
@@ -621,6 +644,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
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.
@@ -648,6 +675,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
}
}
+ $optionsSet = false;
+
foreach ($arguments as $argument) {
$parsedDate = null;
@@ -655,10 +684,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
$this->setTimezone($argument);
} elseif ($this->dateInterval === null &&
(
- \is_string($argument) && preg_match(
- '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T0-9].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i',
+ (\is_string($argument) && preg_match(
+ '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T\d].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i',
$argument
- ) ||
+ )) ||
$argument instanceof DateInterval ||
$argument instanceof Closure
) &&
@@ -671,15 +700,17 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
$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) {
@@ -691,6 +722,8 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
if ($this->options === null) {
$this->setOptions(0);
}
+
+ $this->constructed = true;
}
/**
@@ -703,6 +736,17 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
return clone $this;
}
+ /**
+ * Prepare the instance to be set (self if mutable to be mutated,
+ * copy if immutable to generate a new instance).
+ *
+ * @return static
+ */
+ protected function copyIfImmutable()
+ {
+ return $this;
+ }
+
/**
* Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names.
*
@@ -794,7 +838,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param string $dateClass
*
- * @return $this
+ * @return static
*/
public function setDateClass(string $dateClass)
{
@@ -802,15 +846,16 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
throw new NotACarbonClassException($dateClass);
}
- $this->dateClass = $dateClass;
+ $self = $this->copyIfImmutable();
+ $self->dateClass = $dateClass;
if (is_a($dateClass, Carbon::class, true)) {
- $this->toggleOptions(static::IMMUTABLE, false);
+ $self->options = $self->options & ~static::IMMUTABLE;
} elseif (is_a($dateClass, CarbonImmutable::class, true)) {
- $this->toggleOptions(static::IMMUTABLE, true);
+ $self->options = $self->options | static::IMMUTABLE;
}
- return $this;
+ return $self;
}
/**
@@ -830,7 +875,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @throws InvalidIntervalException
*
- * @return $this
+ * @return static
*/
public function setDateInterval($interval)
{
@@ -842,25 +887,24 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
throw new InvalidIntervalException('Empty interval is not accepted.');
}
- $this->dateInterval = $interval;
+ $self = $this->copyIfImmutable();
+ $self->dateInterval = $interval;
- $this->isDefaultInterval = false;
+ $self->isDefaultInterval = false;
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
* Invert the period date interval.
*
- * @return $this
+ * @return static
*/
public function invertDateInterval()
{
- $interval = $this->dateInterval->invert();
-
- return $this->setDateInterval($interval);
+ return $this->setDateInterval($this->dateInterval->invert());
}
/**
@@ -869,14 +913,11 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param DateTime|DateTimeInterface|string $start
* @param DateTime|DateTimeInterface|string|null $end
*
- * @return $this
+ * @return static
*/
public function setDates($start, $end)
{
- $this->setStartDate($start);
- $this->setEndDate($end);
-
- return $this;
+ return $this->setStartDate($start)->setEndDate($end);
}
/**
@@ -886,7 +927,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @throws InvalidArgumentException
*
- * @return $this
+ * @return static
*/
public function setOptions($options)
{
@@ -894,11 +935,12 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
throw new InvalidPeriodParameterException('Invalid options.');
}
- $this->options = $options ?: 0;
+ $self = $this->copyIfImmutable();
+ $self->options = $options ?: 0;
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -919,7 +961,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @throws \InvalidArgumentException
*
- * @return $this
+ * @return static
*/
public function toggleOptions($options, $state = null)
{
@@ -939,7 +981,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param bool $state
*
- * @return $this
+ * @return static
*/
public function excludeStartDate($state = true)
{
@@ -951,7 +993,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param bool $state
*
- * @return $this
+ * @return static
*/
public function excludeEndDate($state = true)
{
@@ -1095,17 +1137,18 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param callable $callback
* @param string $name
*
- * @return $this
+ * @return static
*/
public function addFilter($callback, $name = null)
{
- $tuple = $this->createFilterTuple(\func_get_args());
+ $self = $this->copyIfImmutable();
+ $tuple = $self->createFilterTuple(\func_get_args());
- $this->filters[] = $tuple;
+ $self->filters[] = $tuple;
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -1116,17 +1159,18 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param callable $callback
* @param string $name
*
- * @return $this
+ * @return static
*/
public function prependFilter($callback, $name = null)
{
- $tuple = $this->createFilterTuple(\func_get_args());
+ $self = $this->copyIfImmutable();
+ $tuple = $self->createFilterTuple(\func_get_args());
- array_unshift($this->filters, $tuple);
+ array_unshift($self->filters, $tuple);
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -1134,24 +1178,25 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param callable|string $filter
*
- * @return $this
+ * @return static
*/
public function removeFilter($filter)
{
+ $self = $this->copyIfImmutable();
$key = \is_callable($filter) ? 0 : 1;
- $this->filters = array_values(array_filter(
+ $self->filters = array_values(array_filter(
$this->filters,
function ($tuple) use ($key, $filter) {
return $tuple[$key] !== $filter;
}
));
- $this->updateInternalState();
+ $self->updateInternalState();
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -1189,39 +1234,41 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param array $filters
*
- * @return $this
+ * @return static
*/
public function setFilters(array $filters)
{
- $this->filters = $filters;
+ $self = $this->copyIfImmutable();
+ $self->filters = $filters;
- $this->updateInternalState();
+ $self->updateInternalState();
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
* Reset filters stack.
*
- * @return $this
+ * @return static
*/
public function resetFilters()
{
- $this->filters = [];
+ $self = $this->copyIfImmutable();
+ $self->filters = [];
- if ($this->endDate !== null) {
- $this->filters[] = [static::END_DATE_FILTER, null];
+ if ($self->endDate !== null) {
+ $self->filters[] = [static::END_DATE_FILTER, null];
}
- if ($this->recurrences !== null) {
- $this->filters[] = [static::RECURRENCES_FILTER, null];
+ if ($self->recurrences !== null) {
+ $self->filters[] = [static::RECURRENCES_FILTER, null];
}
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -1231,11 +1278,11 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @throws InvalidArgumentException
*
- * @return $this
+ * @return static
*/
public function setRecurrences($recurrences)
{
- if (!is_numeric($recurrences) && $recurrences !== null || $recurrences < 0) {
+ if ((!is_numeric($recurrences) && $recurrences !== null) || $recurrences < 0) {
throw new InvalidPeriodParameterException('Invalid number of recurrences.');
}
@@ -1243,15 +1290,17 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
return $this->removeFilter(static::RECURRENCES_FILTER);
}
- $this->recurrences = $recurrences === INF ? INF : (int) $recurrences;
+ /** @var self $self */
+ $self = $this->copyIfImmutable();
+ $self->recurrences = $recurrences === INF ? INF : (int) $recurrences;
- if (!$this->hasFilter(static::RECURRENCES_FILTER)) {
- return $this->addFilter(static::RECURRENCES_FILTER);
+ if (!$self->hasFilter(static::RECURRENCES_FILTER)) {
+ return $self->addFilter(static::RECURRENCES_FILTER);
}
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -1262,21 +1311,22 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @throws InvalidPeriodDateException
*
- * @return $this
+ * @return static
*/
public function setStartDate($date, $inclusive = null)
{
- if (!$date = ([$this->dateClass, 'make'])($date)) {
+ if (!$this->isInfiniteDate($date) && !($date = ([$this->dateClass, 'make'])($date))) {
throw new InvalidPeriodDateException('Invalid start date.');
}
- $this->startDate = $date;
+ $self = $this->copyIfImmutable();
+ $self->startDate = $date;
if ($inclusive !== null) {
- $this->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive);
+ $self = $self->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive);
}
- return $this;
+ return $self;
}
/**
@@ -1287,11 +1337,11 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @throws \InvalidArgumentException
*
- * @return $this
+ * @return static
*/
public function setEndDate($date, $inclusive = null)
{
- if ($date !== null && !$date = ([$this->dateClass, 'make'])($date)) {
+ if ($date !== null && !$this->isInfiniteDate($date) && !$date = ([$this->dateClass, 'make'])($date)) {
throw new InvalidPeriodDateException('Invalid end date.');
}
@@ -1299,19 +1349,20 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
return $this->removeFilter(static::END_DATE_FILTER);
}
- $this->endDate = $date;
+ $self = $this->copyIfImmutable();
+ $self->endDate = $date;
if ($inclusive !== null) {
- $this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive);
+ $self = $self->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive);
}
- if (!$this->hasFilter(static::END_DATE_FILTER)) {
- return $this->addFilter(static::END_DATE_FILTER);
+ if (!$self->hasFilter(static::END_DATE_FILTER)) {
+ return $self->addFilter(static::END_DATE_FILTER);
}
- $this->handleChangedParameters();
+ $self->handleChangedParameters();
- return $this;
+ return $self;
}
/**
@@ -1457,13 +1508,21 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
public function toString()
{
+ $format = $this->localToStringFormat ?? static::$toStringFormat;
+
+ if ($format instanceof Closure) {
+ return $format($this);
+ }
+
$translator = ([$this->dateClass, 'getTranslator'])();
$parts = [];
- $format = !$this->startDate->isStartOfDay() || $this->endDate && !$this->endDate->isStartOfDay()
- ? 'Y-m-d H:i:s'
- : 'Y-m-d';
+ $format = $format ?? (
+ !$this->startDate->isStartOfDay() || ($this->endDate && !$this->endDate->isStartOfDay())
+ ? 'Y-m-d H:i:s'
+ : 'Y-m-d'
+ );
if ($this->recurrences !== null) {
$parts[] = $this->translate('period_recurrences', [], $this->recurrences, $translator);
@@ -1506,9 +1565,9 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
if (!method_exists($className, 'instance')) {
if (is_a($className, DatePeriod::class, true)) {
return new $className(
- $this->getStartDate(),
+ $this->rawDate($this->getStartDate()),
$this->getDateInterval(),
- $this->getEndDate() ? $this->getIncludedEndDate() : $this->getRecurrences(),
+ $this->getEndDate() ? $this->rawDate($this->getIncludedEndDate()) : $this->getRecurrences(),
$this->isStartExcluded() ? DatePeriod::EXCLUDE_START_DATE : 0
);
}
@@ -1534,6 +1593,39 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
return $this->cast(DatePeriod::class);
}
+ /**
+ * Return `true` if the period has no custom filter and is guaranteed to be endless.
+ *
+ * Note that we can't check if a period is endless as soon as it has custom filters
+ * because filters can emit `CarbonPeriod::END_ITERATION` to stop the iteration in
+ * a way we can't predict without actually iterating the period.
+ */
+ public function isUnfilteredAndEndLess(): bool
+ {
+ foreach ($this->filters as $filter) {
+ switch ($filter) {
+ case [static::RECURRENCES_FILTER, null]:
+ if ($this->recurrences !== null && is_finite($this->recurrences)) {
+ return false;
+ }
+
+ break;
+
+ case [static::END_DATE_FILTER, null]:
+ if ($this->endDate !== null && !$this->endDate->isEndOfTime()) {
+ return false;
+ }
+
+ break;
+
+ default:
+ return false;
+ }
+ }
+
+ return true;
+ }
+
/**
* Convert the date period into an array without changing current iteration state.
*
@@ -1541,6 +1633,10 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
public function toArray()
{
+ if ($this->isUnfilteredAndEndLess()) {
+ throw new EndLessPeriodException("Endless period can't be converted to array nor counted.");
+ }
+
$state = [
$this->key,
$this->current ? $this->current->avoidMutation() : null,
@@ -1572,6 +1668,16 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
public function first()
{
+ if ($this->isUnfilteredAndEndLess()) {
+ foreach ($this as $date) {
+ $this->rewind();
+
+ return $date;
+ }
+
+ return null;
+ }
+
return ($this->toArray() ?: [])[0] ?? null;
}
@@ -1626,54 +1732,80 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
return $roundedValue;
}
- $first = \count($parameters) >= 1 ? $parameters[0] : null;
- $second = \count($parameters) >= 2 ? $parameters[1] : null;
-
switch ($method) {
case 'start':
case 'since':
- return $this->setStartDate($first, $second);
+ self::setDefaultParameters($parameters, [
+ [0, 'date', null],
+ ]);
+
+ return $this->setStartDate(...$parameters);
case 'sinceNow':
- return $this->setStartDate(new Carbon(), $first);
+ return $this->setStartDate(new Carbon(), ...$parameters);
case 'end':
case 'until':
- return $this->setEndDate($first, $second);
+ self::setDefaultParameters($parameters, [
+ [0, 'date', null],
+ ]);
+
+ return $this->setEndDate(...$parameters);
case 'untilNow':
- return $this->setEndDate(new Carbon(), $first);
+ return $this->setEndDate(new Carbon(), ...$parameters);
case 'dates':
case 'between':
- return $this->setDates($first, $second);
+ self::setDefaultParameters($parameters, [
+ [0, 'start', null],
+ [1, 'end', null],
+ ]);
+
+ return $this->setDates(...$parameters);
case 'recurrences':
case 'times':
- return $this->setRecurrences($first);
+ self::setDefaultParameters($parameters, [
+ [0, 'recurrences', null],
+ ]);
+
+ return $this->setRecurrences(...$parameters);
case 'options':
- return $this->setOptions($first);
+ self::setDefaultParameters($parameters, [
+ [0, 'options', null],
+ ]);
+
+ return $this->setOptions(...$parameters);
case 'toggle':
- return $this->toggleOptions($first, $second);
+ self::setDefaultParameters($parameters, [
+ [0, 'options', null],
+ ]);
+
+ return $this->toggleOptions(...$parameters);
case 'filter':
case 'push':
- return $this->addFilter($first, $second);
+ return $this->addFilter(...$parameters);
case 'prepend':
- return $this->prependFilter($first, $second);
+ return $this->prependFilter(...$parameters);
case 'filters':
- return $this->setFilters($first ?: []);
+ self::setDefaultParameters($parameters, [
+ [0, 'filters', []],
+ ]);
+
+ return $this->setFilters(...$parameters);
case 'interval':
case 'each':
case 'every':
case 'step':
case 'stepBy':
- return $this->setDateInterval($first);
+ return $this->setDateInterval(...$parameters);
case 'invert':
return $this->invertDateInterval();
@@ -1693,15 +1825,19 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
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]
- )(
- \count($parameters) === 0 ? 1 : $first
- ));
+ )(...$parameters));
}
- if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) {
+ $dateClass = $this->dateClass;
+
+ if ($this->localStrictModeEnabled ?? $dateClass::isStrictModeEnabled()) {
throw new UnknownMethodException($method);
}
@@ -1717,18 +1853,19 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
public function setTimezone($timezone)
{
- $this->tzName = $timezone;
- $this->timezone = $timezone;
+ $self = $this->copyIfImmutable();
+ $self->tzName = $timezone;
+ $self->timezone = $timezone;
- if ($this->startDate) {
- $this->setStartDate($this->startDate->setTimezone($timezone));
+ if ($self->startDate) {
+ $self = $self->setStartDate($self->startDate->setTimezone($timezone));
}
- if ($this->endDate) {
- $this->setEndDate($this->endDate->setTimezone($timezone));
+ if ($self->endDate) {
+ $self = $self->setEndDate($self->endDate->setTimezone($timezone));
}
- return $this;
+ return $self;
}
/**
@@ -1740,18 +1877,19 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*/
public function shiftTimezone($timezone)
{
- $this->tzName = $timezone;
- $this->timezone = $timezone;
+ $self = $this->copyIfImmutable();
+ $self->tzName = $timezone;
+ $self->timezone = $timezone;
- if ($this->startDate) {
- $this->setStartDate($this->startDate->shiftTimezone($timezone));
+ if ($self->startDate) {
+ $self = $self->setStartDate($self->startDate->shiftTimezone($timezone));
}
- if ($this->endDate) {
- $this->setEndDate($this->endDate->shiftTimezone($timezone));
+ if ($self->endDate) {
+ $self = $self->setEndDate($self->endDate->shiftTimezone($timezone));
}
- return $this;
+ return $self;
}
/**
@@ -1896,7 +2034,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
/**
* 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
*
@@ -1911,7 +2049,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
/**
* 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
*
@@ -1934,7 +2072,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
/**
* 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
*
@@ -1949,7 +2087,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
/**
* 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
*
@@ -2130,19 +2268,18 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param float|int|string|\DateInterval|null $precision
* @param string $function
*
- * @return $this
+ * @return static
*/
public function roundUnit($unit, $precision = 1, $function = 'round')
{
- $this->setStartDate($this->getStartDate()->roundUnit($unit, $precision, $function));
+ $self = $this->copyIfImmutable();
+ $self = $self->setStartDate($self->getStartDate()->roundUnit($unit, $precision, $function));
- if ($this->endDate) {
- $this->setEndDate($this->getEndDate()->roundUnit($unit, $precision, $function));
+ if ($self->endDate) {
+ $self = $self->setEndDate($self->getEndDate()->roundUnit($unit, $precision, $function));
}
- $this->setDateInterval($this->getDateInterval()->roundUnit($unit, $precision, $function));
-
- return $this;
+ return $self->setDateInterval($self->getDateInterval()->roundUnit($unit, $precision, $function));
}
/**
@@ -2151,7 +2288,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param string $unit
* @param float|int|string|\DateInterval|null $precision
*
- * @return $this
+ * @return static
*/
public function floorUnit($unit, $precision = 1)
{
@@ -2164,7 +2301,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param string $unit
* @param float|int|string|\DateInterval|null $precision
*
- * @return $this
+ * @return static
*/
public function ceilUnit($unit, $precision = 1)
{
@@ -2177,7 +2314,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
* @param float|int|string|\DateInterval|null $precision
* @param string $function
*
- * @return $this
+ * @return static
*/
public function round($precision = null, $function = 'round')
{
@@ -2192,7 +2329,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param float|int|string|\DateInterval|null $precision
*
- * @return $this
+ * @return static
*/
public function floor($precision = null)
{
@@ -2204,7 +2341,7 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
*
* @param float|int|string|\DateInterval|null $precision
*
- * @return $this
+ * @return static
*/
public function ceil($precision = null)
{
@@ -2393,9 +2530,9 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
protected function handleChangedParameters()
{
if (($this->getOptions() & static::IMMUTABLE) && $this->dateClass === Carbon::class) {
- $this->setDateClass(CarbonImmutable::class);
+ $this->dateClass = CarbonImmutable::class;
} elseif (!($this->getOptions() & static::IMMUTABLE) && $this->dateClass === CarbonImmutable::class) {
- $this->setDateClass(Carbon::class);
+ $this->dateClass = Carbon::class;
}
$this->validationResult = null;
@@ -2555,14 +2692,51 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable
if (\is_string($value)) {
$value = trim($value);
- if (!preg_match('/^P[0-9T]/', $value) &&
- !preg_match('/^R[0-9]/', $value) &&
- preg_match('/[a-z0-9]/i', $value)
+ if (!preg_match('/^P[\dT]/', $value) &&
+ !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);
}
}
return null;
}
+
+ private function isInfiniteDate($date): bool
+ {
+ return $date instanceof CarbonInterface && ($date->isEndOfTime() || $date->isStartOfTime());
+ }
+
+ private function rawDate($date): ?DateTimeInterface
+ {
+ if ($date === false || $date === null) {
+ return null;
+ }
+
+ if ($date instanceof CarbonInterface) {
+ return $date->isMutable()
+ ? $date->toDateTime()
+ : $date->toDateTimeImmutable();
+ }
+
+ if (\in_array(\get_class($date), [DateTime::class, DateTimeImmutable::class], true)) {
+ return $date;
+ }
+
+ $class = $date instanceof DateTime ? DateTime::class : DateTimeImmutable::class;
+
+ return new $class($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
+ }
+
+ private static function setDefaultParameters(array &$parameters, array $defaults): void
+ {
+ foreach ($defaults as [$index, $name, $value]) {
+ if (!\array_key_exists($index, $parameters) && !\array_key_exists($name, $parameters)) {
+ $parameters[$index] = $value;
+ }
+ }
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php
new file mode 100644
index 00000000..f0d0ee28
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon;
+
+class CarbonPeriodImmutable extends CarbonPeriod
+{
+ /**
+ * Default date class of iteration items.
+ *
+ * @var string
+ */
+ protected const DEFAULT_DATE_CLASS = CarbonImmutable::class;
+
+ /**
+ * Date class of iteration items.
+ *
+ * @var string
+ */
+ protected $dateClass = CarbonImmutable::class;
+
+ /**
+ * Prepare the instance to be set (self if mutable to be mutated,
+ * copy if immutable to generate a new instance).
+ *
+ * @return static
+ */
+ protected function copyIfImmutable()
+ {
+ return $this->constructed ? clone $this : $this;
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php
index b4d16ba9..c81899f1 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php
@@ -30,7 +30,7 @@ class CarbonTimeZone extends DateTimeZone
throw new InvalidTimeZoneException('Absolute timezone offset cannot be greater than 100.');
}
- return ($timezone >= 0 ? '+' : '').$timezone.':00';
+ return ($timezone >= 0 ? '+' : '').ltrim($timezone, '+').':00';
}
protected static function getDateTimeZoneNameFromMixed($timezone)
@@ -101,15 +101,15 @@ class CarbonTimeZone extends DateTimeZone
$tz = static::getDateTimeZoneFromName($object);
}
- if ($tz === false) {
- if (Carbon::isStrictModeEnabled()) {
- throw new InvalidTimeZoneException('Unknown or bad timezone ('.($objectDump ?: $object).')');
- }
+ if ($tz !== false) {
+ return new static($tz->getName());
+ }
- return false;
+ if (Carbon::isStrictModeEnabled()) {
+ throw new InvalidTimeZoneException('Unknown or bad timezone ('.($objectDump ?: $object).')');
}
- return new static($tz->getName());
+ return false;
}
/**
@@ -231,15 +231,15 @@ class CarbonTimeZone extends DateTimeZone
{
$tz = $this->toRegionName($date);
- if ($tz === false) {
- if (Carbon::isStrictModeEnabled()) {
- throw new InvalidTimeZoneException('Unknown timezone for offset '.$this->getOffset($date ?: Carbon::now($this)).' seconds.');
- }
+ if ($tz !== false) {
+ return new static($tz);
+ }
- return false;
+ if (Carbon::isStrictModeEnabled()) {
+ throw new InvalidTimeZoneException('Unknown timezone for offset '.$this->getOffset($date ?: Carbon::now($this)).' seconds.');
}
- return new static($tz);
+ return false;
}
/**
@@ -252,6 +252,18 @@ class CarbonTimeZone extends DateTimeZone
return $this->getName();
}
+ /**
+ * Return the type number:
+ *
+ * Type 1; A UTC offset, such as -0300
+ * Type 2; A timezone abbreviation, such as GMT
+ * Type 3: A timezone identifier, such as Europe/London
+ */
+ public function getType(): int
+ {
+ return preg_match('/"timezone_type";i:(\d)/', serialize($this), $match) ? (int) $match[1] : 3;
+ }
+
/**
* Create a CarbonTimeZone from mixed input.
*
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php
deleted file mode 100644
index ccc457fc..00000000
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonDoctrineType.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-/**
- * This file is part of the Carbon package.
- *
- * (c) Brian Nesbitt <[email protected]>
- *
- * 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php
deleted file mode 100644
index bf476a77..00000000
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonImmutableType.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
- * This file is part of the Carbon package.
- *
- * (c) Brian Nesbitt <[email protected]>
- *
- * 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php
deleted file mode 100644
index 9289d84d..00000000
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonType.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
- * This file is part of the Carbon package.
- *
- * (c) Brian Nesbitt <[email protected]>
- *
- * 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php
deleted file mode 100644
index 29b0bb95..00000000
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Doctrine/DateTimeType.php
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-/**
- * Thanks to https://github.com/flaushi for his suggestion:
- * https://github.com/doctrine/dbal/issues/2873#issuecomment-534956358
- */
-namespace Carbon\Doctrine;
-
-use Carbon\Carbon;
-use Doctrine\DBAL\Types\VarDateTimeType;
-
-class DateTimeType extends VarDateTimeType implements CarbonDoctrineType
-{
- /** @use CarbonTypeConverter<Carbon> */
- use CarbonTypeConverter;
-}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php
index b3a08719..3ca8837d 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php
@@ -11,19 +11,38 @@
namespace Carbon\Exceptions;
-use Exception;
+use Throwable;
class BadComparisonUnitException extends UnitException
{
+ /**
+ * The unit.
+ *
+ * @var string
+ */
+ protected $unit;
+
/**
* Constructor.
*
* @param string $unit
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($unit, $code = 0, Exception $previous = null)
+ public function __construct($unit, $code = 0, Throwable $previous = null)
{
+ $this->unit = $unit;
+
parent::__construct("Bad comparison unit: '$unit'", $code, $previous);
}
+
+ /**
+ * Get the unit.
+ *
+ * @return string
+ */
+ public function getUnit(): string
+ {
+ return $this->unit;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php
index d5cd5564..2e222e54 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php
@@ -12,19 +12,38 @@
namespace Carbon\Exceptions;
use BadMethodCallException as BaseBadMethodCallException;
-use Exception;
+use Throwable;
class BadFluentConstructorException extends BaseBadMethodCallException implements BadMethodCallException
{
+ /**
+ * The method.
+ *
+ * @var string
+ */
+ protected $method;
+
/**
* Constructor.
*
* @param string $method
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($method, $code = 0, Exception $previous = null)
+ public function __construct($method, $code = 0, Throwable $previous = null)
{
+ $this->method = $method;
+
parent::__construct(sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous);
}
+
+ /**
+ * Get the method.
+ *
+ * @return string
+ */
+ public function getMethod(): string
+ {
+ return $this->method;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php
index 1d7ec542..4ceaa2ef 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php
@@ -12,19 +12,38 @@
namespace Carbon\Exceptions;
use BadMethodCallException as BaseBadMethodCallException;
-use Exception;
+use Throwable;
class BadFluentSetterException extends BaseBadMethodCallException implements BadMethodCallException
{
+ /**
+ * The setter.
+ *
+ * @var string
+ */
+ protected $setter;
+
/**
* Constructor.
*
- * @param string $method
+ * @param string $setter
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
+ */
+ public function __construct($setter, $code = 0, Throwable $previous = null)
+ {
+ $this->setter = $setter;
+
+ parent::__construct(sprintf("Unknown fluent setter '%s'", $setter), $code, $previous);
+ }
+
+ /**
+ * Get the setter.
+ *
+ * @return string
*/
- public function __construct($method, $code = 0, Exception $previous = null)
+ public function getSetter(): string
{
- parent::__construct(sprintf("Unknown fluent setter '%s'", $method), $code, $previous);
+ return $this->setter;
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php
index 73c2dd86..108206d3 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php
@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface BadMethodCallException extends Exception
{
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php
new file mode 100644
index 00000000..e1049269
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\Exceptions;
+
+use RuntimeException as BaseRuntimeException;
+
+final class EndLessPeriodException extends BaseRuntimeException implements RuntimeException
+{
+ //
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php
index 3bbbd77d..8ad747e7 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php
@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface Exception
{
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php
index a48d4f93..db334c6c 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php
@@ -11,20 +11,38 @@
namespace Carbon\Exceptions;
-use Exception;
use RuntimeException as BaseRuntimeException;
+use Throwable;
class ImmutableException extends BaseRuntimeException implements RuntimeException
{
+ /**
+ * The value.
+ *
+ * @var string
+ */
+ protected $value;
+
/**
* Constructor.
*
* @param string $value the immutable type/value
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($value, $code = 0, Exception $previous = null)
+ public function __construct($value, $code = 0, Throwable $previous = null)
{
+ $this->value = $value;
parent::__construct("$value is immutable.", $code, $previous);
}
+
+ /**
+ * Get the value.
+ *
+ * @return string
+ */
+ public function getValue(): string
+ {
+ return $this->value;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php
index 9739f4d1..5b013cd5 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php
@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface InvalidArgumentException extends Exception
{
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php
index d2f37019..a421401f 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidCastException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php
index 99bb91c0..c9ecb6b0 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php
@@ -11,8 +11,8 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException
{
@@ -36,9 +36,9 @@ class InvalidDateException extends BaseInvalidArgumentException implements Inval
* @param string $field
* @param mixed $value
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($field, $value, $code = 0, Exception $previous = null)
+ public function __construct($field, $value, $code = 0, Throwable $previous = null)
{
$this->field = $field;
$this->value = $value;
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php
index 3341b49d..92d55fe3 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidFormatException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php
index 5f9f142e..69cf4128 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidIntervalException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php
index a37e3f5e..9bd84a96 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidPeriodDateException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php
index ede47712..cf2c9024 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidPeriodParameterException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php
index 892e16e8..f7259558 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidTimeZoneException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php
index 3fbe3fc4..2c8ec9ba 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class InvalidTypeException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php
index 2b4c48e3..7a87632c 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php
@@ -12,24 +12,39 @@
namespace Carbon\Exceptions;
use Carbon\CarbonInterface;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException
{
+ /**
+ * The className.
+ *
+ * @var string
+ */
+ protected $className;
+
/**
* Constructor.
*
* @param string $className
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
+ */
+ public function __construct($className, $code = 0, Throwable $previous = null)
+ {
+ $this->className = $className;
+
+ parent::__construct(sprintf('Given class does not implement %s: %s', CarbonInterface::class, $className), $code, $previous);
+ }
+
+ /**
+ * Get the className.
+ *
+ * @return string
*/
- public function __construct($className, $code = 0, Exception $previous = null)
+ public function getClassName(): string
{
- parent::__construct(sprintf(
- 'Given class does not implement %s: %s',
- CarbonInterface::class,
- $className
- ), $code, $previous);
+ return $this->className;
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php
index 41bb6290..4edd7a48 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class NotAPeriodException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php
index adbc36cd..f2c54684 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php
@@ -11,8 +11,8 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
class NotLocaleAwareException extends BaseInvalidArgumentException implements InvalidArgumentException
{
@@ -21,9 +21,9 @@ class NotLocaleAwareException extends BaseInvalidArgumentException implements In
*
* @param mixed $object
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($object, $code = 0, Exception $previous = null)
+ public function __construct($object, $code = 0, Throwable $previous = null)
{
$dump = \is_object($object) ? \get_class($object) : \gettype($object);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php
index 54822d95..2c586d0b 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php
@@ -11,8 +11,8 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
// This will extends OutOfRangeException instead of InvalidArgumentException since 3.0.0
// use OutOfRangeException as BaseOutOfRangeException;
@@ -55,9 +55,9 @@ class OutOfRangeException extends BaseInvalidArgumentException implements Invali
* @param mixed $max
* @param mixed $value
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($unit, $min, $max, $value, $code = 0, Exception $previous = null)
+ public function __construct($unit, $min, $max, $value, $code = 0, Throwable $previous = null)
{
$this->unit = $unit;
$this->min = $min;
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php
index 0314c5d8..5416fd14 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php
@@ -11,23 +11,78 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
class ParseErrorException extends BaseInvalidArgumentException implements InvalidArgumentException
{
+ /**
+ * The expected.
+ *
+ * @var string
+ */
+ protected $expected;
+
+ /**
+ * The actual.
+ *
+ * @var string
+ */
+ protected $actual;
+
+ /**
+ * The help message.
+ *
+ * @var string
+ */
+ protected $help;
+
/**
* Constructor.
*
* @param string $expected
* @param string $actual
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($expected, $actual, $help = '', $code = 0, Exception $previous = null)
+ public function __construct($expected, $actual, $help = '', $code = 0, Throwable $previous = null)
{
+ $this->expected = $expected;
+ $this->actual = $actual;
+ $this->help = $help;
+
$actual = $actual === '' ? 'data is missing' : "get '$actual'";
parent::__construct(trim("Format expected $expected but $actual\n$help"), $code, $previous);
}
+
+ /**
+ * Get the expected.
+ *
+ * @return string
+ */
+ public function getExpected(): string
+ {
+ return $this->expected;
+ }
+
+ /**
+ * Get the actual.
+ *
+ * @return string
+ */
+ public function getActual(): string
+ {
+ return $this->actual;
+ }
+
+ /**
+ * Get the help message.
+ *
+ * @return string
+ */
+ public function getHelp(): string
+ {
+ return $this->help;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php
index 24bf5a68..ad196f79 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php
@@ -13,4 +13,5 @@ namespace Carbon\Exceptions;
interface RuntimeException extends Exception
{
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php
index 8bd8653e..ee99953b 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
class UnitException extends BaseInvalidArgumentException implements InvalidArgumentException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php
index 39ee12c5..0e723056 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php
@@ -11,19 +11,38 @@
namespace Carbon\Exceptions;
-use Exception;
+use Throwable;
class UnitNotConfiguredException extends UnitException
{
+ /**
+ * The unit.
+ *
+ * @var string
+ */
+ protected $unit;
+
/**
* Constructor.
*
* @param string $unit
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($unit, $code = 0, Exception $previous = null)
+ public function __construct($unit, $code = 0, Throwable $previous = null)
{
+ $this->unit = $unit;
+
parent::__construct("Unit $unit have no configuration to get total from other units.", $code, $previous);
}
+
+ /**
+ * Get the unit.
+ *
+ * @return string
+ */
+ public function getUnit(): string
+ {
+ return $this->unit;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php
index 6c8c01b6..5c504975 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php
@@ -11,20 +11,39 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
class UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException
{
+ /**
+ * The getter.
+ *
+ * @var string
+ */
+ protected $getter;
+
/**
* Constructor.
*
- * @param string $name getter name
+ * @param string $getter getter name
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
+ */
+ public function __construct($getter, $code = 0, Throwable $previous = null)
+ {
+ $this->getter = $getter;
+
+ parent::__construct("Unknown getter '$getter'", $code, $previous);
+ }
+
+ /**
+ * Get the getter.
+ *
+ * @return string
*/
- public function __construct($name, $code = 0, Exception $previous = null)
+ public function getGetter(): string
{
- parent::__construct("Unknown getter '$name'", $code, $previous);
+ return $this->getter;
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php
index 901db986..75273a70 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php
@@ -12,19 +12,38 @@
namespace Carbon\Exceptions;
use BadMethodCallException as BaseBadMethodCallException;
-use Exception;
+use Throwable;
class UnknownMethodException extends BaseBadMethodCallException implements BadMethodCallException
{
+ /**
+ * The method.
+ *
+ * @var string
+ */
+ protected $method;
+
/**
* Constructor.
*
* @param string $method
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($method, $code = 0, Exception $previous = null)
+ public function __construct($method, $code = 0, Throwable $previous = null)
{
+ $this->method = $method;
+
parent::__construct("Method $method does not exist.", $code, $previous);
}
+
+ /**
+ * Get the method.
+ *
+ * @return string
+ */
+ public function getMethod(): string
+ {
+ return $this->method;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php
index c9e9c9ff..a795f5d7 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php
@@ -11,20 +11,39 @@
namespace Carbon\Exceptions;
-use Exception;
use InvalidArgumentException as BaseInvalidArgumentException;
+use Throwable;
class UnknownSetterException extends BaseInvalidArgumentException implements BadMethodCallException
{
+ /**
+ * The setter.
+ *
+ * @var string
+ */
+ protected $setter;
+
/**
* Constructor.
*
- * @param string $name setter name
+ * @param string $setter setter name
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
+ */
+ public function __construct($setter, $code = 0, Throwable $previous = null)
+ {
+ $this->setter = $setter;
+
+ parent::__construct("Unknown setter '$setter'", $code, $previous);
+ }
+
+ /**
+ * Get the setter.
+ *
+ * @return string
*/
- public function __construct($name, $code = 0, Exception $previous = null)
+ public function getSetter(): string
{
- parent::__construct("Unknown setter '$name'", $code, $previous);
+ return $this->setter;
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php
index d965c82a..ecd7f7a5 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php
@@ -11,19 +11,38 @@
namespace Carbon\Exceptions;
-use Exception;
+use Throwable;
class UnknownUnitException extends UnitException
{
+ /**
+ * The unit.
+ *
+ * @var string
+ */
+ protected $unit;
+
/**
* Constructor.
*
* @param string $unit
* @param int $code
- * @param Exception|null $previous
+ * @param Throwable|null $previous
*/
- public function __construct($unit, $code = 0, Exception $previous = null)
+ public function __construct($unit, $code = 0, Throwable $previous = null)
{
+ $this->unit = $unit;
+
parent::__construct("Unknown unit '$unit'.", $code, $previous);
}
+
+ /**
+ * Get the unit.
+ *
+ * @return string
+ */
+ public function getUnit(): string
+ {
+ return $this->unit;
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php
index 6f8b39f5..1654ab11 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php
@@ -11,20 +11,9 @@
namespace Carbon\Exceptions;
-use Exception;
use RuntimeException as BaseRuntimeException;
class UnreachableException extends BaseRuntimeException implements RuntimeException
{
- /**
- * Constructor.
- *
- * @param string $message
- * @param int $code
- * @param Exception|null $previous
- */
- public function __construct($message, $code = 0, Exception $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
+ //
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php
index f8c72890..d497535f 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Factory.php
@@ -177,10 +177,10 @@ use ReflectionMethod;
* parameter of null.
* /!\ Use this method for unit tests only.
* @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
- * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
- * use other method or custom format passed to format() method if you need to dump an other string
+ * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
+ * use other method or custom format passed to format() method if you need to dump another string
* format.
- * Set the default format used when type juggling a Carbon instance to a string
+ * Set the default format used when type juggling a Carbon instance to a string.
* @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use.
* @method Carbon setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use UTF-8 language packages on every machine.
@@ -231,7 +231,7 @@ use ReflectionMethod;
* 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php
index 596ee806..d88a1cf6 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php
+++ b/data/web/inc/lib/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 @@ use Closure;
* @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
@@ -175,10 +177,10 @@ use Closure;
* parameter of null.
* /!\ Use this method for unit tests only.
* @method void setToStringFormat($format) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
- * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
- * use other method or custom format passed to format() method if you need to dump an other string
+ * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
+ * use other method or custom format passed to format() method if you need to dump another string
* format.
- * Set the default format used when type juggling a Carbon instance to a string
+ * Set the default format used when type juggling a Carbon instance to a string.
* @method void setTranslator(TranslatorInterface $translator) Set the default translator instance to use.
* @method CarbonImmutable setUtf8($utf8) @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
* You should rather use UTF-8 language packages on every machine.
@@ -229,7 +231,7 @@ use Closure;
* 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 @@ use Closure;
*
* </autodoc>
*/
-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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php
index 75fe47f6..35a22b1d 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php
index 362009e2..35180965 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php
index 362009e2..35180965 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php
index 0ac09958..2d420084 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php
index 0ac09958..2d420084 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php
index e6f0531d..b3fb1cfe 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php
@@ -16,6 +16,7 @@
* - JD Isaacks
* - Atef Ben Ali (atefBB)
* - Mohamed Sabil (mohamedsabil83)
+ * - Abdullah-Alhariri
*/
$months = [
'يناير',
@@ -90,4 +91,5 @@ return [
],
'meridiem' => ['ص', 'م'],
'weekend' => [5, 6],
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php
index 55bb10c3..2792745c 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php
index 362009e2..35180965 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php
index e790b99e..503c60d2 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php
@@ -9,5 +9,10 @@
* file that was distributed with this source code.
*/
+/*
+ * Authors:
+ * - Abdullah-Alhariri
+ */
return array_replace_recursive(require __DIR__.'/ar.php', [
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php
index 362009e2..35180965 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php
index 10aaa2ed..550b0c73 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php
@@ -15,6 +15,7 @@
* - JD Isaacks
* - Atef Ben Ali (atefBB)
* - Mohamed Sabil (mohamedsabil83)
+ * - Abdullah-Alhariri
*/
$months = [
'يناير',
@@ -89,4 +90,5 @@ return [
],
'meridiem' => ['ص', 'م'],
'weekend' => [5, 6],
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php
index 362009e2..35180965 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php
index 0ac09958..2d420084 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -24,4 +25,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php
index 5dc29388..169fe88a 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php
@@ -12,6 +12,7 @@
/*
* Authors:
* - IBM Globalization Center of Competency, Yamato Software Laboratory [email protected]
+ * - Abdullah-Alhariri
*/
return array_replace_recursive(require __DIR__.'/ar.php', [
'formats' => [
@@ -23,4 +24,5 @@ return array_replace_recursive(require __DIR__.'/ar.php', [
'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'],
'day_of_first_week_of_year' => 1,
+ 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php
index 51b4d0cc..ee736365 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/be.php
@@ -9,13 +9,12 @@
* file that was distributed with this source code.
*/
-// @codeCoverageIgnoreStart
-
use Carbon\CarbonInterface;
use Symfony\Component\Translation\PluralizationRules;
-if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
- PluralizationRules::set(function ($number) {
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
}, 'be');
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php
index 861acd2a..1c16421a 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php
@@ -9,5 +9,15 @@
* file that was distributed with this source code.
*/
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'ca');
+ }, 'ca_ES_Valencia');
+}
+// @codeCoverageIgnoreEnd
+
return array_replace_recursive(require __DIR__.'/ca.php', [
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php
new file mode 100644
index 00000000..acf4dc28
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/*
+ * Authors:
+ * - Swara Mohammed
+ */
+$months = [
+ 'ڕێبەندان',
+ 'ڕەشەمە',
+ 'نەورۆز',
+ 'گوڵان',
+ 'جۆزەردان',
+ 'پوشپەڕ',
+ 'گەلاوێژ',
+ 'خەرمانان',
+ 'ڕەزبەر',
+ 'گەڵاڕێزان',
+ 'سەرماوەرز',
+ 'بەفرانبار',
+];
+
+return [
+ 'year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']),
+ 'a_year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']),
+ 'month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']),
+ 'a_month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']),
+ 'week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']),
+ 'a_week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']),
+ 'day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']),
+ 'a_day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']),
+ 'hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']),
+ 'a_hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']),
+ 'minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']),
+ 'a_minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']),
+ 'second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']),
+ 'a_second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']),
+ 'ago' => 'پێش :time',
+ 'from_now' => ':time لە ئێستاوە',
+ 'after' => 'دوای :time',
+ 'before' => 'پێش :time',
+ 'diff_now' => 'ئێستا',
+ 'diff_today' => 'ئەمڕۆ',
+ 'diff_today_regexp' => 'ڕۆژ(?:\\s+لە)?(?:\\s+کاتژمێر)?',
+ 'diff_yesterday' => 'دوێنێ',
+ 'diff_yesterday_regexp' => 'دوێنێ(?:\\s+لە)?(?:\\s+کاتژمێر)?',
+ 'diff_tomorrow' => 'سبەینێ',
+ 'diff_tomorrow_regexp' => 'سبەینێ(?:\\s+لە)?(?:\\s+کاتژمێر)?',
+ 'diff_before_yesterday' => 'پێش دوێنێ',
+ 'diff_after_tomorrow' => 'دوای سبەینێ',
+ 'period_recurrences' => implode('|', ['{0}جار', '{1}جار', '{2}:count دووجار', ']2,11[:count جار', ']10,Inf[:count جار']),
+ 'period_interval' => 'هەموو :interval',
+ 'period_start_date' => 'لە :date',
+ 'period_end_date' => 'بۆ :date',
+ 'months' => $months,
+ 'months_short' => $months,
+ 'weekdays' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'],
+ 'weekdays_short' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'],
+ 'weekdays_min' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'],
+ 'list' => ['، ', ' و '],
+ 'first_day_of_week' => 6,
+ 'day_of_first_week_of_year' => 1,
+ 'formats' => [
+ 'LT' => 'HH:mm',
+ 'LTS' => 'HH:mm:ss',
+ 'L' => 'D/M/YYYY',
+ 'LL' => 'D MMMM YYYY',
+ 'LLL' => 'D MMMM YYYY HH:mm',
+ 'LLLL' => 'dddd D MMMM YYYY HH:mm',
+ ],
+ 'calendar' => [
+ 'sameDay' => '[ئەمڕۆ لە کاتژمێر] LT',
+ 'nextDay' => '[سبەینێ لە کاتژمێر] LT',
+ 'nextWeek' => 'dddd [لە کاتژمێر] LT',
+ 'lastDay' => '[دوێنێ لە کاتژمێر] LT',
+ 'lastWeek' => 'dddd [لە کاتژمێر] LT',
+ 'sameElse' => 'L',
+ ],
+ 'meridiem' => ['پ.ن', 'د.ن'],
+ 'weekend' => [5, 6],
+];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs.php
index 8cff9a01..c01e3ccc 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cs.php
@@ -101,7 +101,8 @@ return [
'after' => $za,
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
- 'months' => ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
+ 'months' => ['ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince'],
+ 'months_standalone' => ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
'months_short' => ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'],
'weekdays' => ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
'weekdays_short' => ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'],
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy.php
index ab7c45a4..119274f0 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/cy.php
@@ -60,7 +60,7 @@ return [
'ordinal' => function ($number) {
return $number.(
$number > 20
- ? (\in_array($number, [40, 50, 60, 80, 100]) ? 'fed' : 'ain')
+ ? (\in_array((int) $number, [40, 50, 60, 80, 100], true) ? 'fed' : 'ain')
: ([
'', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed', // 11eg to 20fed
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da.php
index 4e6640a6..322f91d5 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/da.php
@@ -18,6 +18,7 @@
* - Jens Herlevsen
* - Ulrik McArdle (mcardle)
* - Frederik Sauer (FrittenKeeZ)
+ * - Janus Bahs Jacquet (kokoshneta)
*/
return [
'year' => ':count år|:count år',
@@ -41,7 +42,7 @@ return [
'second' => ':count sekund|:count sekunder',
'a_second' => 'få sekunder|:count sekunder',
's' => ':count s.',
- 'ago' => ':time siden',
+ 'ago' => 'for :time siden',
'from_now' => 'om :time',
'after' => ':time efter',
'before' => ':time før',
@@ -70,9 +71,9 @@ return [
],
'ordinal' => ':number.',
'months' => ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
- 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
+ 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'],
- 'weekdays_short' => ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'],
+ 'weekdays_short' => ['søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.'],
'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'],
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de.php
index ff00c974..3b70750e 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/de.php
@@ -105,4 +105,13 @@ return [
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
'list' => [', ', ' und '],
+ 'ordinal_words' => [
+ 'of' => 'im',
+ 'first' => 'erster',
+ 'second' => 'zweiter',
+ 'third' => 'dritter',
+ 'fourth' => 'vierten',
+ 'fifth' => 'fünfter',
+ 'last' => 'letzten',
+ ],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en.php
index a8633fef..f81f617e 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en.php
@@ -72,7 +72,7 @@ return [
$lastDigit = $number % 10;
return $number.(
- (~~($number % 100 / 10) === 1) ? 'th' : (
+ ((int) ($number % 100 / 10) === 1) ? 'th' : (
($lastDigit === 1) ? 'st' : (
($lastDigit === 2) ? 'nd' : (
($lastDigit === 3) ? 'rd' : 'th'
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php
index e2dd81db..10d9cd8f 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php
index f77ec39c..1c4fcfd0 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/es.php
@@ -26,6 +26,7 @@
* - quinterocesar
* - Daniel Commesse Liévanos (danielcommesse)
* - Pete Scopes (pdscopes)
+ * - gam04
*/
use Carbon\CarbonInterface;
@@ -108,4 +109,13 @@ return [
'day_of_first_week_of_year' => 4,
'list' => [', ', ' y '],
'meridiem' => ['a. m.', 'p. m.'],
+ 'ordinal_words' => [
+ 'of' => 'de',
+ 'first' => 'primer',
+ 'second' => 'segundo',
+ 'third' => 'tercer',
+ 'fourth' => 'cuarto',
+ 'fifth' => 'quinto',
+ 'last' => 'último',
+ ],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi.php
index 2003e1ea..edf2d6d3 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fi.php
@@ -74,8 +74,10 @@ return [
'LTS' => 'HH.mm:ss',
'L' => 'D.M.YYYY',
'LL' => 'dddd D. MMMM[ta] YYYY',
+ 'll' => 'ddd D. MMM YYYY',
'LLL' => 'D.MM. HH.mm',
'LLLL' => 'D. MMMM[ta] YYYY HH.mm',
+ 'llll' => 'D. MMM YY HH.mm',
],
'weekdays' => ['sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai'],
'weekdays_short' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'],
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr.php
index 73fe5e41..f4c7247b 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/fr.php
@@ -90,7 +90,7 @@ return [
'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'],
'ordinal' => function ($number, $period) {
switch ($period) {
- // In french, only the first has be ordinal, other number remains cardinal
+ // In French, only the first has to be ordinal, other number remains cardinal
// @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais
case 'D':
return $number.($number === 1 ? 'er' : '');
@@ -111,4 +111,13 @@ return [
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
'list' => [', ', ' et '],
+ 'ordinal_words' => [
+ 'of' => 'de',
+ 'first' => 'premier',
+ 'second' => 'deuxième',
+ 'third' => 'troisième',
+ 'fourth' => 'quatrième',
+ 'fifth' => 'cinquième',
+ 'last' => 'dernier',
+ ],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php
index b2d2ac11..b7583eec 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/hu.php
@@ -82,7 +82,7 @@ return [
'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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php
index 605bcbb5..49875d7e 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/it.php
@@ -55,7 +55,7 @@ return [
'µs' => ':countµs',
'ago' => ':time fa',
'from_now' => function ($time) {
- return (preg_match('/^[0-9].+$/', $time) ? 'tra' : 'in')." $time";
+ return (preg_match('/^\d.+$/', $time) ? 'tra' : 'in')." $time";
},
'after' => ':time dopo',
'before' => ':time prima',
@@ -103,4 +103,13 @@ return [
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
'list' => [', ', ' e '],
+ 'ordinal_words' => [
+ 'of' => 'di',
+ 'first' => 'primo',
+ 'second' => 'secondo',
+ 'third' => 'terzo',
+ 'fourth' => 'quarto',
+ 'fifth' => 'quinto',
+ 'last' => 'ultimo',
+ ],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku.php
index b001e301..189960c8 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ku.php
@@ -11,31 +11,29 @@
/*
* Authors:
- * - Halwest Manguri
- * - Kardo Qadir
+ * - Unicode, Inc.
*/
-$months = ['کانونی دووەم', 'شوبات', 'ئازار', 'نیسان', 'ئایار', 'حوزەیران', 'تەمموز', 'ئاب', 'ئەیلول', 'تشرینی یەکەم', 'تشرینی دووەم', 'کانونی یەکەم'];
-
-$weekdays = ['دوو شەممە', 'سێ شەممە', 'چوار شەممە', 'پێنج شەممە', 'هەینی', 'شەممە', 'یەک شەممە'];
return [
- 'ago' => 'پێش :time',
- 'from_now' => ':time لە ئێستاوە',
- 'after' => 'دوای :time',
- 'before' => 'پێش :time',
- 'year' => '{0}ساڵ|{1}ساڵێک|{2}٢ ساڵ|[3,10]:count ساڵ|[11,Inf]:count ساڵ',
- 'month' => '{0}مانگ|{1}مانگێک|{2}٢ مانگ|[3,10]:count مانگ|[11,Inf]:count مانگ',
- 'week' => '{0}هەفتە|{1}هەفتەیەک|{2}٢ هەفتە|[3,10]:count هەفتە|[11,Inf]:count هەفتە',
- 'day' => '{0}ڕۆژ|{1}ڕۆژێک|{2}٢ ڕۆژ|[3,10]:count ڕۆژ|[11,Inf]:count ڕۆژ',
- 'hour' => '{0}کاتژمێر|{1}کاتژمێرێک|{2}٢ کاتژمێر|[3,10]:count کاتژمێر|[11,Inf]:count کاتژمێر',
- 'minute' => '{0}خولەک|{1}خولەکێک|{2}٢ خولەک|[3,10]:count خولەک|[11,Inf]:count خولەک',
- 'second' => '{0}چرکە|{1}چرکەیەک|{2}٢ چرکە|[3,10]:count چرکە|[11,Inf]:count چرکە',
- 'months' => $months,
- 'months_standalone' => $months,
- 'months_short' => $months,
- 'weekdays' => $weekdays,
- 'weekdays_short' => $weekdays,
- 'weekdays_min' => $weekdays,
+ 'ago' => 'berî :time',
+ 'from_now' => 'di :time de',
+ 'after' => ':time piştî',
+ 'before' => ':time berê',
+ 'year' => ':count sal',
+ 'year_ago' => ':count salê|:count salan',
+ 'year_from_now' => 'salekê|:count salan',
+ 'month' => ':count meh',
+ 'week' => ':count hefte',
+ 'day' => ':count roj',
+ 'hour' => ':count saet',
+ 'minute' => ':count deqîqe',
+ 'second' => ':count saniye',
+ 'months' => ['rêbendanê', 'reşemiyê', 'adarê', 'avrêlê', 'gulanê', 'pûşperê', 'tîrmehê', 'gelawêjê', 'rezberê', 'kewçêrê', 'sermawezê', 'berfanbarê'],
+ 'months_standalone' => ['rêbendan', 'reşemî', 'adar', 'avrêl', 'gulan', 'pûşper', 'tîrmeh', 'gelawêj', 'rezber', 'kewçêr', 'sermawez', 'berfanbar'],
+ 'months_short' => ['rêb', 'reş', 'ada', 'avr', 'gul', 'pûş', 'tîr', 'gel', 'rez', 'kew', 'ser', 'ber'],
+ 'weekdays' => ['yekşem', 'duşem', 'sêşem', 'çarşem', 'pêncşem', 'în', 'şemî'],
+ 'weekdays_short' => ['yş', 'dş', 'sş', 'çş', 'pş', 'în', 'ş'],
+ 'weekdays_min' => ['Y', 'D', 'S', 'Ç', 'P', 'Î', 'Ş'],
'list' => [', ', ' û '],
'first_day_of_week' => 6,
'day_of_first_week_of_year' => 1,
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php
index 693eceb5..d5cba7ca 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/lv.php
@@ -176,7 +176,8 @@ return [
'weekdays' => $daysOfWeek,
'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'],
'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'],
- 'months' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'],
+ 'months' => ['janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris'],
+ 'months_standalone' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'],
'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'],
'meridiem' => ['priekšpusdiena', 'pēcpusdiena'],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php
index 717d199b..38c6434d 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/mn.php
@@ -26,6 +26,7 @@
* - Nicolás Hock Isaza
* - Ochirkhuyag
* - Batmandakh
+ * - lucifer-crybaby
*/
return [
'year' => ':count жил',
@@ -43,38 +44,55 @@ return [
'second' => ':count секунд',
's' => ':countс',
- 'ago' => ':timeн өмнө',
- 'year_ago' => ':count жилий',
- 'month_ago' => ':count сары',
- 'day_ago' => ':count хоногий',
- 'hour_ago' => ':count цагий',
- 'minute_ago' => ':count минуты',
- 'second_ago' => ':count секунды',
+ 'ago_mode' => 'last',
+ 'ago' => ':time өмнө',
+ 'year_ago' => ':count жилийн',
+ 'y_ago' => ':count жилийн',
+ 'month_ago' => ':count сарын',
+ 'm_ago' => ':count сарын',
+ 'day_ago' => ':count хоногийн',
+ 'd_ago' => ':count хоногийн',
+ 'week_ago' => ':count долоо хоногийн',
+ 'w_ago' => ':count долоо хоногийн',
+ 'hour_ago' => ':count цагийн',
+ 'minute_ago' => ':count минутын',
+ 'second_ago' => ':count секундын',
+ 'from_now_mode' => 'last',
'from_now' => 'одоогоос :time',
'year_from_now' => ':count жилийн дараа',
+ 'y_from_now' => ':count жилийн дараа',
'month_from_now' => ':count сарын дараа',
+ 'm_from_now' => ':count сарын дараа',
'day_from_now' => ':count хоногийн дараа',
+ 'd_from_now' => ':count хоногийн дараа',
'hour_from_now' => ':count цагийн дараа',
'minute_from_now' => ':count минутын дараа',
'second_from_now' => ':count секундын дараа',
- // Does it required to make translation for before, after as follows? hmm, I think we've made it with ago and from now keywords already. Anyway, I've included it just in case of undesired action...
- 'after' => ':timeн дараа',
- 'year_after' => ':count жилий',
- 'month_after' => ':count сары',
- 'day_after' => ':count хоногий',
- 'hour_after' => ':count цагий',
- 'minute_after' => ':count минуты',
- 'second_after' => ':count секунды',
+ 'after_mode' => 'last',
+ 'after' => ':time дараа',
+ 'year_after' => ':count жилийн',
+ 'y_after' => ':count жилийн',
+ 'month_after' => ':count сарын',
+ 'm_after' => ':count сарын',
+ 'day_after' => ':count хоногийн',
+ 'd_after' => ':count хоногийн',
+ 'hour_after' => ':count цагийн',
+ 'minute_after' => ':count минутын',
+ 'second_after' => ':count секундын',
- 'before' => ':timeн өмнө',
- 'year_before' => ':count жилий',
- 'month_before' => ':count сары',
- 'day_before' => ':count хоногий',
- 'hour_before' => ':count цагий',
- 'minute_before' => ':count минуты',
- 'second_before' => ':count секунды',
+ 'before_mode' => 'last',
+ 'before' => ':time өмнө',
+ 'year_before' => ':count жилийн',
+ 'y_before' => ':count жилийн',
+ 'month_before' => ':count сарын',
+ 'm_before' => ':count сарын',
+ 'day_before' => ':count хоногийн',
+ 'd_before' => ':count хоногийн',
+ 'hour_before' => ':count цагийн',
+ 'minute_before' => ':count минутын',
+ 'second_before' => ':count секундын',
'list' => ', ',
'diff_now' => 'одоо',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php
index 36934eeb..c9e80854 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ms.php
@@ -48,7 +48,7 @@ return [
'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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php
index 89693e67..c9411d69 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/oc.php
@@ -17,7 +17,7 @@
use Symfony\Component\Translation\PluralizationRules;
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
- PluralizationRules::set(function ($number) {
+ PluralizationRules::set(static function ($number) {
return $number == 1 ? 0 : 1;
}, 'oc');
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php
index f0196c0d..b7205354 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pl.php
@@ -62,7 +62,7 @@ return [
},
'after' => ':time po',
'before' => ':time przed',
- 'diff_now' => 'przed chwilą',
+ 'diff_now' => 'teraz',
'diff_today' => 'Dziś',
'diff_today_regexp' => 'Dziś(?:\\s+o)?',
'diff_yesterday' => 'wczoraj',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php
index 0af89499..bb6359b1 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/pt.php
@@ -104,4 +104,13 @@ return [
'first_day_of_week' => 1,
'day_of_first_week_of_year' => 4,
'list' => [', ', ' e '],
+ 'ordinal_words' => [
+ 'of' => 'de',
+ 'first' => 'primeira',
+ 'second' => 'segunda',
+ 'third' => 'terceira',
+ 'fourth' => 'quarta',
+ 'fifth' => 'quinta',
+ 'last' => 'última',
+ ],
];
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php
index e4aa5a1c..e03b5067 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sh.php
@@ -13,7 +13,7 @@
use Symfony\Component\Translation\PluralizationRules;
if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) {
- PluralizationRules::set(function ($number) {
+ PluralizationRules::set(static function ($number) {
return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
}, 'sh');
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk.php
index fd0f6b3e..f9702e96 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sk.php
@@ -31,33 +31,89 @@
* - jofi
* - Jakub ADAMEC
* - 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',
+ 'second' => ':count sekunda|:count sekundy|:count sekúnd',
+ 'a_second' => 'sekunda|:count sekundy|:count sekúnd',
's' => ':count s',
- 'ago' => 'pred :time',
- 'from_now' => 'za :time',
- 'after' => 'o :time neskôr',
- 'before' => ':time predtým',
- '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',
+ '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',
+ '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 '],
@@ -72,8 +128,26 @@ return [
'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' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'],
+ '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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php
index 2e197212..1f1d1b33 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sl.php
@@ -49,9 +49,9 @@ return [
'a_second' => '{1}nekaj sekund|:count sekunda|:count sekundi|:count sekunde|:count sekund',
's' => ':count s',
- 'year_ago' => ':count letom|:count leti|:count leti|:count leti',
- 'y_ago' => ':count letom|:count leti|:count leti|:count leti',
- 'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
+ '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 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php
index c09df19c..8becbc57 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php
@@ -24,28 +24,28 @@
use Carbon\CarbonInterface;
return [
- 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
+ 'year' => ':count година|:count године|:count година',
'y' => ':count г.',
- 'month' => '{1}:count месец|{2,3,4}:count месеца|[0,Inf[:count месеци',
+ 'month' => ':count месец|:count месеца|:count месеци',
'm' => ':count м.',
- 'week' => '{1}:count недеља|{2,3,4}:count недеље|[0,Inf[:count недеља',
+ 'week' => ':count недеља|:count недеље|:count недеља',
'w' => ':count нед.',
- 'day' => '{1,21,31}:count дан|[0,Inf[:count дана',
+ 'day' => ':count дан|:count дана|:count дана',
'd' => ':count д.',
- 'hour' => '{1,21}:count сат|{2,3,4,22,23,24}:count сата|[0,Inf[:count сати',
+ 'hour' => ':count сат|:count сата|:count сати',
'h' => ':count ч.',
- 'minute' => '{1,21,31,41,51}:count минут|[0,Inf[:count минута',
+ 'minute' => ':count минут|:count минута|:count минута',
'min' => ':count мин.',
- 'second' => '{1,21,31,41,51}:count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[0,Inf[:count секунди',
+ 'second' => ':count секунд|:count секунде|:count секунди',
's' => ':count сек.',
'ago' => 'пре :time',
'from_now' => 'за :time',
'after' => ':time након',
'before' => ':time пре',
- 'year_from_now' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
- 'year_ago' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
- 'week_from_now' => '{1}:count недељу|{2,3,4}:count недеље|[0,Inf[:count недеља',
- 'week_ago' => '{1}:count недељу|{2,3,4}:count недеље|[0,Inf[:count недеља',
+ 'year_from_now' => ':count годину|:count године|:count година',
+ 'year_ago' => ':count годину|:count године|:count година',
+ 'week_from_now' => ':count недељу|:count недеље|:count недеља',
+ 'week_ago' => ':count недељу|:count недеље|:count недеља',
'diff_now' => 'управо сада',
'diff_today' => 'данас',
'diff_today_regexp' => 'данас(?:\\s+у)?',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php
index 0fb63d76..4b29a45c 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php
@@ -9,6 +9,16 @@
* file that was distributed with this source code.
*/
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'sr');
+ }, 'sr_Cyrl_BA');
+}
+// @codeCoverageIgnoreEnd
+
return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [
'formats' => [
'LT' => 'HH:mm',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php
index d13229ab..28d22fd2 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php
@@ -16,32 +16,41 @@
*/
use Carbon\CarbonInterface;
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'sr');
+ }, 'sr_Cyrl_ME');
+}
+// @codeCoverageIgnoreEnd
return [
- 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
+ 'year' => ':count година|:count године|:count година',
'y' => ':count г.',
- 'month' => '{1}:count мјесец|{2,3,4}:count мјесеца|[0,Inf[:count мјесеци',
+ 'month' => ':count мјесец|:count мјесеца|:count мјесеци',
'm' => ':count мј.',
- 'week' => '{1}:count недјеља|{2,3,4}:count недјеље|[0,Inf[:count недјеља',
+ 'week' => ':count недјеља|:count недјеље|:count недјеља',
'w' => ':count нед.',
- 'day' => '{1,21,31}:count дан|[0,Inf[:count дана',
+ 'day' => ':count дан|:count дана|:count дана',
'd' => ':count д.',
- 'hour' => '{1,21}:count сат|{2,3,4,22,23,24}:count сата|[0,Inf[:count сати',
+ 'hour' => ':count сат|:count сата|:count сати',
'h' => ':count ч.',
- 'minute' => '{1,21,31,41,51}:count минут|[0,Inf[:count минута',
+ 'minute' => ':count минут|:count минута|:count минута',
'min' => ':count мин.',
- 'second' => '{1,21,31,41,51}:count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[0,Inf[:count секунди',
+ 'second' => ':count секунд|:count секунде|:count секунди',
's' => ':count сек.',
'ago' => 'прије :time',
'from_now' => 'за :time',
'after' => ':time након',
'before' => ':time прије',
- 'year_from_now' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
- 'year_ago' => '{1,21,31,41,51}:count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[:count година',
+ 'year_from_now' => ':count годину|:count године|:count година',
+ 'year_ago' => ':count годину|:count године|:count година',
- 'week_from_now' => '{1}:count недјељу|{2,3,4}:count недјеље|[0,Inf[:count недјеља',
- 'week_ago' => '{1}:count недјељу|{2,3,4}:count недјеље|[0,Inf[:count недјеља',
+ 'week_from_now' => ':count недјељу|:count недјеље|:count недјеља',
+ 'week_ago' => ':count недјељу|:count недјеље|:count недјеља',
'diff_now' => 'управо сада',
'diff_today' => 'данас',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php
index 492baf0c..d6e29b86 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php
@@ -9,6 +9,16 @@
* file that was distributed with this source code.
*/
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'sr');
+ }, 'sr_Cyrl_XK');
+}
+// @codeCoverageIgnoreEnd
+
return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [
'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php
index 897c674a..95b2770d 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php
@@ -9,6 +9,16 @@
* file that was distributed with this source code.
*/
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'sr');
+ }, 'sr_Latn_BA');
+}
+// @codeCoverageIgnoreEnd
+
return array_replace_recursive(require __DIR__.'/sr_Latn.php', [
'formats' => [
'LT' => 'HH:mm',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php
index e2133ef1..5b8f2d06 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php
@@ -16,6 +16,15 @@
*/
use Carbon\CarbonInterface;
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'sr');
+ }, 'sr_Latn_ME');
+}
+// @codeCoverageIgnoreEnd
return array_replace_recursive(require __DIR__.'/sr.php', [
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
@@ -27,6 +36,7 @@ return array_replace_recursive(require __DIR__.'/sr.php', [
'before' => ':time prije',
'week_from_now' => ':count nedjelju|:count nedjelje|:count nedjelja',
'week_ago' => ':count nedjelju|:count nedjelje|:count nedjelja',
+ 'second_ago' => ':count sekund|:count sekunde|:count sekundi',
'diff_tomorrow' => 'sjutra',
'calendar' => [
'nextDay' => '[sjutra u] LT',
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php
index d0b9d10b..5278e2e5 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php
@@ -9,6 +9,16 @@
* file that was distributed with this source code.
*/
+use Symfony\Component\Translation\PluralizationRules;
+
+// @codeCoverageIgnoreStart
+if (class_exists(PluralizationRules::class)) {
+ PluralizationRules::set(static function ($number) {
+ return PluralizationRules::get($number, 'sr');
+ }, 'sr_Latn_XK');
+}
+// @codeCoverageIgnoreEnd
+
return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [
'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'],
]);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss.php
index cd4b9190..1c52c9bf 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/ss.php
@@ -50,7 +50,7 @@ return [
$lastDigit = $number % 10;
return $number.(
- (~~($number % 100 / 10) === 1) ? 'e' : (
+ ((int) ($number % 100 / 10) === 1) ? 'e' : (
($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e'
)
);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv.php
index ca33e1c4..1706c719 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/sv.php
@@ -70,7 +70,7 @@ return [
$lastDigit = $number % 10;
return $number.(
- (~~($number % 100 / 10) === 1) ? 'e' : (
+ ((int) ($number % 100 / 10) === 1) ? 'e' : (
($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e'
)
);
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php
index b267b000..4217d16e 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Lang/uk.php
@@ -55,7 +55,7 @@ $processHoursFunction = function (CarbonInterface $date, string $format) {
*/
return [
'year' => ':count рік|:count роки|:count років',
- 'y' => ':countр',
+ 'y' => ':countр|:countрр|:countрр',
'a_year' => '{1}рік|:count рік|:count роки|:count років',
'month' => ':count місяць|:count місяці|:count місяців',
'm' => ':countм',
@@ -193,6 +193,7 @@ return [
'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'],
];
+ $format = $format ?? '';
$nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format)
? 'accusative'
: (
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php
index 8be0569e..84e241e3 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php
@@ -24,6 +24,22 @@ use Throwable;
class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
+ /** @var callable|null */
+ protected $appGetter = null;
+
+ /** @var callable|null */
+ protected $localeGetter = null;
+
+ public function setAppGetter(?callable $appGetter): void
+ {
+ $this->appGetter = $appGetter;
+ }
+
+ public function setLocaleGetter(?callable $localeGetter): void
+ {
+ $this->localeGetter = $localeGetter;
+ }
+
public function boot()
{
$this->updateLocale();
@@ -44,8 +60,12 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider
public function updateLocale()
{
- $app = $this->app && method_exists($this->app, 'getLocale') ? $this->app : app('translator');
- $locale = $app->getLocale();
+ $locale = $this->getLocale();
+
+ if ($locale === null) {
+ return;
+ }
+
Carbon::setLocale($locale);
CarbonImmutable::setLocale($locale);
CarbonPeriod::setLocale($locale);
@@ -70,6 +90,34 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider
// Needed for Laravel < 5.3 compatibility
}
+ protected function getLocale()
+ {
+ if ($this->localeGetter) {
+ return ($this->localeGetter)();
+ }
+
+ $app = $this->getApp();
+ $app = $app && method_exists($app, 'getLocale')
+ ? $app
+ : $this->getGlobalApp('translator');
+
+ return $app ? $app->getLocale() : null;
+ }
+
+ protected function getApp()
+ {
+ if ($this->appGetter) {
+ return ($this->appGetter)();
+ }
+
+ return $this->app ?? $this->getGlobalApp();
+ }
+
+ protected function getGlobalApp(...$args)
+ {
+ return \function_exists('app') ? \app(...$args) : null;
+ }
+
protected function isEventDispatcher($instance)
{
return $instance instanceof EventDispatcher
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php
new file mode 100644
index 00000000..c0548087
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\MessageFormatter;
+
+use ReflectionMethod;
+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
+{
+ /**
+ * Wrapped formatter.
+ *
+ * @var MessageFormatterInterface
+ */
+ protected $formatter;
+
+ public function __construct(?MessageFormatterInterface $formatter = null)
+ {
+ $this->formatter = $formatter ?? new MessageFormatter();
+ }
+
+ protected function transformLocale(?string $locale): ?string
+ {
+ return $locale ? preg_replace('/[_@][A-Za-z][a-z]{2,}/', '', $locale) : $locale;
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php
index fc6fd2a7..fde67b36 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php
@@ -14,6 +14,12 @@ declare(strict_types=1);
namespace Carbon\PHPStan;
use Closure;
+use InvalidArgumentException;
+use PHPStan\BetterReflection\Reflection\Adapter\ReflectionParameter as AdapterReflectionParameter;
+use PHPStan\BetterReflection\Reflection\Adapter\ReflectionType as AdapterReflectionType;
+use PHPStan\BetterReflection\Reflection\ReflectionClass as BetterReflectionClass;
+use PHPStan\BetterReflection\Reflection\ReflectionFunction as BetterReflectionFunction;
+use PHPStan\BetterReflection\Reflection\ReflectionParameter as BetterReflectionParameter;
use PHPStan\Reflection\Php\BuiltinMethodReflection;
use PHPStan\TrinaryLogic;
use ReflectionClass;
@@ -64,24 +70,34 @@ 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)
{
$this->className = $className;
$this->methodName = $methodName;
- $this->reflectionFunction = \is_array($macro)
+ $rawReflectionFunction = \is_array($macro)
? new ReflectionMethod($macro[0], $macro[1])
: new ReflectionFunction($macro);
- $this->parameters = $this->reflectionFunction->getParameters();
+ $this->reflectionFunction = self::hasModernParser()
+ ? $this->getReflectionFunction($macro)
+ : $rawReflectionFunction; // @codeCoverageIgnore
+ $this->parameters = array_map(
+ function ($parameter) {
+ if ($parameter instanceof BetterReflectionParameter) {
+ return new AdapterReflectionParameter($parameter);
+ }
+
+ return $parameter; // @codeCoverageIgnore
+ },
+ $this->reflectionFunction->getParameters()
+ );
- if ($this->reflectionFunction->isClosure()) {
+ if ($rawReflectionFunction->isClosure()) {
try {
- $closure = $this->reflectionFunction->getClosure();
+ $closure = $rawReflectionFunction->getClosure();
$boundClosure = Closure::bind($closure, new stdClass());
$this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null);
} catch (Throwable $e) {
@@ -90,6 +106,31 @@ abstract class AbstractMacro implements BuiltinMethodReflection
}
}
+ private function getReflectionFunction($spec)
+ {
+ if (\is_array($spec) && \count($spec) === 2 && \is_string($spec[1])) {
+ \assert($spec[1] !== '');
+
+ if (\is_object($spec[0])) {
+ return BetterReflectionClass::createFromInstance($spec[0])
+ ->getMethod($spec[1]);
+ }
+
+ return BetterReflectionClass::createFromName($spec[0])
+ ->getMethod($spec[1]);
+ }
+
+ if (\is_string($spec)) {
+ return BetterReflectionFunction::createFromName($spec);
+ }
+
+ if ($spec instanceof Closure) {
+ return BetterReflectionFunction::createFromClosure($spec);
+ }
+
+ throw new InvalidArgumentException('Could not create reflection from the spec given'); // @codeCoverageIgnore
+ }
+
/**
* {@inheritdoc}
*/
@@ -175,7 +216,13 @@ abstract class AbstractMacro implements BuiltinMethodReflection
*/
public function getReturnType(): ?ReflectionType
{
- return $this->reflectionFunction->getReturnType();
+ $type = $this->reflectionFunction->getReturnType();
+
+ if ($type instanceof ReflectionType) {
+ return $type; // @codeCoverageIgnore
+ }
+
+ return self::adaptType($type);
}
/**
@@ -205,18 +252,35 @@ abstract class AbstractMacro implements BuiltinMethodReflection
return $this;
}
- /**
- * {@inheritdoc}
- */
- public function getReflection(): ?ReflectionMethod
+ public function getTentativeReturnType(): ?ReflectionType
{
- return $this->reflectionFunction instanceof ReflectionMethod
- ? $this->reflectionFunction
- : null;
+ return null;
}
- public function getTentativeReturnType(): ?ReflectionType
+ public function returnsByReference(): TrinaryLogic
{
- return null;
+ return TrinaryLogic::createNo();
+ }
+
+ private static function adaptType($type)
+ {
+ $method = method_exists(AdapterReflectionType::class, 'fromTypeOrNull')
+ ? 'fromTypeOrNull'
+ : 'fromReturnTypeOrNull'; // @codeCoverageIgnore
+
+ return AdapterReflectionType::$method($type);
+ }
+
+ private static function hasModernParser(): bool
+ {
+ static $modernParser = null;
+
+ if ($modernParser !== null) {
+ return $modernParser;
+ }
+
+ $modernParser = method_exists(AdapterReflectionType::class, 'fromTypeOrNull');
+
+ return $modernParser;
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php
index 83925873..de3e51f6 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php
@@ -13,9 +13,16 @@ declare(strict_types=1);
namespace Carbon\PHPStan;
+use PHPStan\BetterReflection\Reflection\Adapter;
use PHPStan\Reflection\Php\BuiltinMethodReflection;
use ReflectionMethod;
+$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getReflection');
+
+require $method->hasReturnType() && $method->getReturnType()->getName() === Adapter\ReflectionMethod::class
+ ? __DIR__.'/../../../lazy/Carbon/PHPStan/AbstractMacroStatic.php'
+ : __DIR__.'/../../../lazy/Carbon/PHPStan/AbstractMacroBuiltin.php';
+
$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getFileName');
require $method->hasReturnType()
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php
index 8e2524c0..2cd6fce5 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php
@@ -11,10 +11,12 @@
namespace Carbon\PHPStan;
+use PHPStan\Reflection\Assertions;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\MethodsClassReflectionExtension;
use PHPStan\Reflection\Php\PhpMethodReflectionFactory;
+use PHPStan\Reflection\ReflectionProvider;
use PHPStan\Type\TypehintHelper;
/**
@@ -38,10 +40,13 @@ final class MacroExtension implements MethodsClassReflectionExtension
* Extension constructor.
*
* @param PhpMethodReflectionFactory $methodReflectionFactory
+ * @param ReflectionProvider $reflectionProvider
*/
- public function __construct(PhpMethodReflectionFactory $methodReflectionFactory)
- {
- $this->scanner = new MacroScanner();
+ public function __construct(
+ PhpMethodReflectionFactory $methodReflectionFactory,
+ ReflectionProvider $reflectionProvider
+ ) {
+ $this->scanner = new MacroScanner($reflectionProvider);
$this->methodReflectionFactory = $methodReflectionFactory;
}
@@ -59,6 +64,7 @@ final class MacroExtension implements MethodsClassReflectionExtension
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection
{
$builtinMacro = $this->scanner->getMethod($classReflection->getName(), $methodName);
+ $supportAssertions = class_exists(Assertions::class);
return $this->methodReflectionFactory->create(
$classReflection,
@@ -72,7 +78,11 @@ final class MacroExtension implements MethodsClassReflectionExtension
$builtinMacro->isDeprecated()->yes(),
$builtinMacro->isInternal(),
$builtinMacro->isFinal(),
- $builtinMacro->getDocComment()
+ $supportAssertions ? null : $builtinMacro->getDocComment(),
+ $supportAssertions ? Assertions::createEmpty() : null,
+ null,
+ $builtinMacro->getDocComment(),
+ []
);
}
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php
index d169939d..eb8957d4 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php
@@ -12,35 +12,55 @@
namespace Carbon\PHPStan;
use Carbon\CarbonInterface;
+use PHPStan\Reflection\ReflectionProvider;
use ReflectionClass;
use ReflectionException;
final class MacroScanner
{
/**
- * Return true if the given pair class-method is a Carbon macro.
+ * @var \PHPStan\Reflection\ReflectionProvider
+ */
+ private $reflectionProvider;
+
+ /**
+ * MacroScanner constructor.
*
- * @param string $className
- * @phpstan-param class-string $className
+ * @param \PHPStan\Reflection\ReflectionProvider $reflectionProvider
+ */
+ public function __construct(ReflectionProvider $reflectionProvider)
+ {
+ $this->reflectionProvider = $reflectionProvider;
+ }
+
+ /**
+ * Return true if the given pair class-method is a Carbon macro.
*
- * @param string $methodName
+ * @param class-string $className
+ * @param string $methodName
*
* @return bool
*/
public function hasMethod(string $className, string $methodName): bool
{
- return is_a($className, CarbonInterface::class, true) &&
- \is_callable([$className, 'hasMacro']) &&
+ $classReflection = $this->reflectionProvider->getClass($className);
+
+ if (
+ $classReflection->getName() !== CarbonInterface::class &&
+ !$classReflection->isSubclassOf(CarbonInterface::class)
+ ) {
+ return false;
+ }
+
+ return \is_callable([$className, 'hasMacro']) &&
$className::hasMacro($methodName);
}
/**
* 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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php
index a23e6ed0..f6261d88 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php
@@ -75,6 +75,9 @@ trait Comparison
*/
public function equalTo($date): bool
{
+ $this->discourageNull($date);
+ $this->discourageBoolean($date);
+
return $this == $this->resolveCarbon($date);
}
@@ -155,6 +158,9 @@ trait Comparison
*/
public function greaterThan($date): bool
{
+ $this->discourageNull($date);
+ $this->discourageBoolean($date);
+
return $this > $this->resolveCarbon($date);
}
@@ -216,7 +222,10 @@ trait Comparison
*/
public function greaterThanOrEqualTo($date): bool
{
- return $this >= $date;
+ $this->discourageNull($date);
+ $this->discourageBoolean($date);
+
+ return $this >= $this->resolveCarbon($date);
}
/**
@@ -256,6 +265,9 @@ trait Comparison
*/
public function lessThan($date): bool
{
+ $this->discourageNull($date);
+ $this->discourageBoolean($date);
+
return $this < $this->resolveCarbon($date);
}
@@ -317,7 +329,10 @@ trait Comparison
*/
public function lessThanOrEqualTo($date): bool
{
- return $this <= $date;
+ $this->discourageNull($date);
+ $this->discourageBoolean($date);
+
+ return $this <= $this->resolveCarbon($date);
}
/**
@@ -351,10 +366,10 @@ trait Comparison
}
if ($equal) {
- return $this->greaterThanOrEqualTo($date1) && $this->lessThanOrEqualTo($date2);
+ return $this >= $date1 && $this <= $date2;
}
- return $this->greaterThan($date1) && $this->lessThan($date2);
+ return $this > $date1 && $this < $date2;
}
/**
@@ -448,7 +463,7 @@ trait Comparison
*/
public function isWeekend()
{
- return \in_array($this->dayOfWeek, static::$weekendDays);
+ return \in_array($this->dayOfWeek, static::$weekendDays, true);
}
/**
@@ -548,12 +563,17 @@ trait Comparison
}
/**
- * Determines if the instance is a long year
+ * 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
@@ -565,6 +585,27 @@ trait Comparison
return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
}
+ /**
+ * 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()
+ {
+ return static::create($this->isoWeekYear, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
+ }
+
/**
* Compares the formatted values of the two dates.
*
@@ -621,19 +662,19 @@ trait Comparison
'microsecond' => 'Y-m-d H:i:s.u',
];
- if (!isset($units[$unit])) {
- if (isset($this->$unit)) {
- return $this->resolveCarbon($date)->$unit === $this->$unit;
- }
+ if (isset($units[$unit])) {
+ return $this->isSameAs($units[$unit], $date);
+ }
- if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) {
- throw new BadComparisonUnitException($unit);
- }
+ if (isset($this->$unit)) {
+ return $this->resolveCarbon($date)->$unit === $this->$unit;
+ }
- return false;
+ if ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) {
+ throw new BadComparisonUnitException($unit);
}
- return $this->isSameAs($units[$unit], $date);
+ return false;
}
/**
@@ -981,12 +1022,12 @@ trait Comparison
return $current->startOfMinute()->eq($other);
}
- if (preg_match('/\d(h|am|pm)$/', $tester)) {
+ if (preg_match('/\d(?:h|am|pm)$/', $tester)) {
return $current->startOfHour()->eq($other);
}
if (preg_match(
- '/^(january|february|march|april|may|june|july|august|september|october|november|december)\s+\d+$/i',
+ '/^(?:january|february|march|april|may|june|july|august|september|october|november|december)(?:\s+\d+)?$/i',
$tester
)) {
return $current->startOfMonth()->eq($other->startOfMonth());
@@ -1067,4 +1108,18 @@ trait Comparison
{
return $this->endOfTime ?? false;
}
+
+ private function discourageNull($value): void
+ {
+ if ($value === null) {
+ @trigger_error("Since 2.61.0, it's deprecated to compare a date to null, meaning of such comparison is ambiguous and will no longer be possible in 3.0.0, you should explicitly pass 'now' or make an other check to eliminate null values.", \E_USER_DEPRECATED);
+ }
+ }
+
+ private function discourageBoolean($value): void
+ {
+ if (\is_bool($value)) {
+ @trigger_error("Since 2.61.0, it's deprecated to compare a date to true or false, meaning of such comparison is ambiguous and will no longer be possible in 3.0.0, you should explicitly pass 'now' or make an other check to eliminate boolean values.", \E_USER_DEPRECATED);
+ }
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php
index 8fe008a5..fff8a600 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php
@@ -16,6 +16,7 @@ use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use Carbon\CarbonInterval;
use Carbon\CarbonPeriod;
+use Carbon\CarbonPeriodImmutable;
use Carbon\Exceptions\UnitException;
use Closure;
use DateTime;
@@ -34,39 +35,7 @@ use ReturnTypeWillChange;
*/
trait Converter
{
- /**
- * Format to use for __toString method when type juggling occurs.
- *
- * @var string|Closure|null
- */
- protected static $toStringFormat;
-
- /**
- * Reset the format used to the default when type juggling a Carbon instance to a string
- *
- * @return void
- */
- public static function resetToStringFormat()
- {
- static::setToStringFormat(null);
- }
-
- /**
- * @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
- * You should rather let Carbon object being casted to string with DEFAULT_TO_STRING_FORMAT, and
- * use other method or custom format passed to format() method if you need to dump an other string
- * format.
- *
- * Set the default format used when type juggling a Carbon instance to a string
- *
- * @param string|Closure|null $format
- *
- * @return void
- */
- public static function setToStringFormat($format)
- {
- static::$toStringFormat = $format;
- }
+ use ToStringFormat;
/**
* Returns the formatted date string on success or FALSE on failure.
@@ -110,7 +79,7 @@ trait Converter
*
* @example
* ```
- * echo Carbon::now(); // Carbon instances can be casted to string
+ * echo Carbon::now(); // Carbon instances can be cast to string
* ```
*
* @return string
@@ -158,6 +127,21 @@ trait Converter
return $this->rawFormat('M j, Y');
}
+ /**
+ * Format the instance with the day, and a readable date
+ *
+ * @example
+ * ```
+ * echo Carbon::now()->toFormattedDayDateString();
+ * ```
+ *
+ * @return string
+ */
+ public function toFormattedDayDateString(): string
+ {
+ return $this->rawFormat('D, M j, Y');
+ }
+
/**
* Format the instance as time
*
@@ -622,16 +606,18 @@ trait Converter
$interval = CarbonInterval::make("$interval ".static::pluralUnit($unit));
}
- $period = (new CarbonPeriod())->setDateClass(static::class)->setStartDate($this);
+ $period = ($this->isMutable() ? new CarbonPeriod() : new CarbonPeriodImmutable())
+ ->setDateClass(static::class)
+ ->setStartDate($this);
if ($interval) {
- $period->setDateInterval($interval);
+ $period = $period->setDateInterval($interval);
}
- if (\is_int($end) || \is_string($end) && ctype_digit($end)) {
- $period->setRecurrences($end);
+ if (\is_int($end) || (\is_string($end) && ctype_digit($end))) {
+ $period = $period->setRecurrences($end);
} elseif ($end) {
- $period->setEndDate($end);
+ $period = $period->setEndDate($end);
}
return $period;
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php
index f2adee5f..0d611ea2 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php
@@ -19,6 +19,8 @@ use Carbon\Exceptions\InvalidFormatException;
use Carbon\Exceptions\OutOfRangeException;
use Carbon\Translator;
use Closure;
+use DateMalformedStringException;
+use DateTimeImmutable;
use DateTimeInterface;
use DateTimeZone;
use Exception;
@@ -79,8 +81,8 @@ trait Creator
// Work-around for PHP bug https://bugs.php.net/bug.php?id=67127
if (!str_contains((string) .1, '.')) {
- $locale = setlocale(LC_NUMERIC, '0');
- setlocale(LC_NUMERIC, 'C');
+ $locale = setlocale(LC_NUMERIC, '0'); // @codeCoverageIgnore
+ setlocale(LC_NUMERIC, 'C'); // @codeCoverageIgnore
}
try {
@@ -92,7 +94,7 @@ trait Creator
$this->constructedObjectId = spl_object_hash($this);
if (isset($locale)) {
- setlocale(LC_NUMERIC, $locale);
+ setlocale(LC_NUMERIC, $locale); // @codeCoverageIgnore
}
self::setLastErrors(parent::getLastErrors());
@@ -112,7 +114,7 @@ trait Creator
$safeTz = static::safeCreateDateTimeZone($tz);
if ($safeTz) {
- return $date->setTimezone($safeTz);
+ return ($date instanceof DateTimeImmutable ? $date : clone $date)->setTimezone($safeTz);
}
return $date;
@@ -148,7 +150,7 @@ trait Creator
$instance = new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone());
- if ($date instanceof CarbonInterface || $date instanceof Options) {
+ if ($date instanceof CarbonInterface) {
$settings = $date->getSettings();
if (!$date->hasLocalTranslator()) {
@@ -184,7 +186,13 @@ trait Creator
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);
@@ -354,13 +362,13 @@ trait Creator
* 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
*
@@ -368,7 +376,7 @@ trait Creator
*/
public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $tz = null)
{
- if (\is_string($year) && !is_numeric($year) || $year instanceof DateTimeInterface) {
+ if ((\is_string($year) && !is_numeric($year)) || $year instanceof DateTimeInterface) {
return static::parse($year, $tz ?: (\is_string($month) || $month instanceof DateTimeZone ? $month : null));
}
@@ -634,6 +642,10 @@ trait Creator
$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 @@ trait Creator
$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;
}
@@ -862,6 +876,19 @@ trait Creator
*/
public static function createFromLocaleFormat($format, $locale, $time, $tz = null)
{
+ $format = preg_replace_callback(
+ '/(?:\\\\[a-zA-Z]|[bfkqCEJKQRV]){2,}/',
+ static function (array $match) use ($locale): string {
+ $word = str_replace('\\', '', $match[0]);
+ $translatedWord = static::translateTimeString($word, $locale, 'en');
+
+ return $word === $translatedWord
+ ? $match[0]
+ : preg_replace('/[a-zA-Z]/', '\\\\$0', $translatedWord);
+ },
+ $format
+ );
+
return static::rawCreateFromFormat($format, static::translateTimeString($time, $locale, 'en'), $tz);
}
@@ -907,9 +934,9 @@ trait Creator
if (\is_string($var)) {
$var = trim($var);
- if (!preg_match('/^P[0-9T]/', $var) &&
- !preg_match('/^R[0-9]/', $var) &&
- preg_match('/[a-z0-9]/i', $var)
+ if (!preg_match('/^P[\dT]/', $var) &&
+ !preg_match('/^R\d/', $var) &&
+ preg_match('/[a-z\d]/i', $var)
) {
$date = static::parse($var);
}
@@ -921,13 +948,20 @@ trait Creator
/**
* Set last errors.
*
- * @param array $lastErrors
+ * @param array|bool $lastErrors
*
* @return void
*/
- private static function setLastErrors(array $lastErrors)
+ private static function setLastErrors($lastErrors)
{
- static::$lastErrors = $lastErrors;
+ if (\is_array($lastErrors) || $lastErrors === false) {
+ static::$lastErrors = \is_array($lastErrors) ? $lastErrors : [
+ 'warning_count' => 0,
+ 'warnings' => [],
+ 'error_count' => 0,
+ 'errors' => [],
+ ];
+ }
}
/**
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
index 8c8af6fb..8ae5c178 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
@@ -532,6 +532,7 @@ trait Date
use Creator;
use Difference;
use Macro;
+ use MagicParameter;
use Modifiers;
use Mutability;
use ObjectInitialisation;
@@ -641,9 +642,11 @@ trait Date
/**
* List of minimum and maximums for each unit.
*
+ * @param int $daysInMonth
+ *
* @return array
*/
- protected static function getRangesByUnit()
+ protected static function getRangesByUnit(int $daysInMonth = 31): array
{
return [
// @call roundUnit
@@ -651,7 +654,7 @@ trait Date
// @call roundUnit
'month' => [1, static::MONTHS_PER_YEAR],
// @call roundUnit
- 'day' => [1, 31],
+ 'day' => [1, $daysInMonth],
// @call roundUnit
'hour' => [0, static::HOURS_PER_DAY - 1],
// @call roundUnit
@@ -940,7 +943,7 @@ trait Date
case $name === 'millisecond':
// @property int
case $name === 'milli':
- return (int) floor($this->rawFormat('u') / 1000);
+ return (int) floor(((int) $this->rawFormat('u')) / 1000);
// @property int 1 through 53
case $name === 'week':
@@ -1250,7 +1253,7 @@ trait Date
protected function getTranslatedFormByRegExp($baseKey, $keySuffix, $context, $subKey, $defaultValue)
{
$key = $baseKey.$keySuffix;
- $standaloneKey = "${key}_standalone";
+ $standaloneKey = "{$key}_standalone";
$baseTranslation = $this->getTranslationMessage($key);
if ($baseTranslation instanceof Closure) {
@@ -1259,7 +1262,7 @@ trait Date
if (
$this->getTranslationMessage("$standaloneKey.$subKey") &&
- (!$context || ($regExp = $this->getTranslationMessage("${baseKey}_regexp")) && !preg_match($regExp, $context))
+ (!$context || (($regExp = $this->getTranslationMessage("{$baseKey}_regexp")) && !preg_match($regExp, $context)))
) {
$key = $standaloneKey;
}
@@ -1354,9 +1357,14 @@ trait Date
*/
public function weekday($value = null)
{
- $dayOfWeek = ($this->dayOfWeek + 7 - (int) ($this->getTranslationMessage('first_day_of_week') ?? 0)) % 7;
+ if ($value === null) {
+ return $this->dayOfWeek;
+ }
+
+ $firstDay = (int) ($this->getTranslationMessage('first_day_of_week') ?? 0);
+ $dayOfWeek = ($this->dayOfWeek + 7 - $firstDay) % 7;
- return $value === null ? $dayOfWeek : $this->addDays($value - $dayOfWeek);
+ return $this->addDays((($value + 7 - $firstDay) % 7) - $dayOfWeek);
}
/**
@@ -1373,6 +1381,39 @@ trait Date
return $value === null ? $dayOfWeekIso : $this->addDays($value - $dayOfWeekIso);
}
+ /**
+ * Return the number of days since the start of the week (using the current locale or the first parameter
+ * if explicitly given).
+ *
+ * @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week,
+ * if not provided, start of week is inferred from the locale
+ * (Sunday for en_US, Monday for de_DE, etc.)
+ *
+ * @return int
+ */
+ public function getDaysFromStartOfWeek(int $weekStartsAt = null): int
+ {
+ $firstDay = (int) ($weekStartsAt ?? $this->getTranslationMessage('first_day_of_week') ?? 0);
+
+ return ($this->dayOfWeek + 7 - $firstDay) % 7;
+ }
+
+ /**
+ * Set the day (keeping the current time) to the start of the week + the number of days passed as the first
+ * parameter. First day of week is driven by the locale unless explicitly set with the second parameter.
+ *
+ * @param int $numberOfDays number of days to add after the start of the current week
+ * @param int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week,
+ * if not provided, start of week is inferred from the locale
+ * (Sunday for en_US, Monday for de_DE, etc.)
+ *
+ * @return static
+ */
+ public function setDaysFromStartOfWeek(int $numberOfDays, int $weekStartsAt = null)
+ {
+ return $this->addDays($numberOfDays - $this->getDaysFromStartOfWeek($weekStartsAt));
+ }
+
/**
* Set any unit to a new value without overflowing current other unit given.
*
@@ -1848,9 +1889,18 @@ trait Date
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); // @codeCoverageIgnore
}
- $formatted = strftime($format, strtotime($this->toDateTimeString()));
+ $time = strtotime($this->toDateTimeString());
+ $formatted = ($this->localStrictModeEnabled ?? static::isStrictModeEnabled())
+ ? strftime($format, $time)
+ : @strftime($format, $time);
- return static::$utf8 ? utf8_encode($formatted) : $formatted;
+ return static::$utf8
+ ? (
+ \function_exists('mb_convert_encoding')
+ ? mb_convert_encoding($formatted, 'UTF-8', mb_list_encodings())
+ : utf8_encode($formatted)
+ )
+ : $formatted;
}
/**
@@ -1869,6 +1919,10 @@ trait Date
'LL' => $this->getTranslationMessage('formats.LL', $locale, 'MMMM D, YYYY'),
'LLL' => $this->getTranslationMessage('formats.LLL', $locale, 'MMMM D, YYYY h:mm A'),
'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale, 'dddd, MMMM D, YYYY h:mm A'),
+ 'l' => $this->getTranslationMessage('formats.l', $locale),
+ 'll' => $this->getTranslationMessage('formats.ll', $locale),
+ 'lll' => $this->getTranslationMessage('formats.lll', $locale),
+ 'llll' => $this->getTranslationMessage('formats.llll', $locale),
];
}
@@ -2152,7 +2206,7 @@ trait Date
$input = mb_substr($format, $i);
- if (preg_match('/^(LTS|LT|[Ll]{1,4})/', $input, $match)) {
+ if (preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) {
if ($formats === null) {
$formats = $this->getIsoFormats();
}
@@ -2256,6 +2310,7 @@ trait Date
'c' => true,
'r' => true,
'U' => true,
+ 'T' => true,
];
}
@@ -2359,7 +2414,7 @@ trait Date
$symbol = $second < 0 ? '-' : '+';
$minute = abs($second) / static::SECONDS_PER_MINUTE;
$hour = str_pad((string) floor($minute / static::MINUTES_PER_HOUR), 2, '0', STR_PAD_LEFT);
- $minute = str_pad((string) ($minute % static::MINUTES_PER_HOUR), 2, '0', STR_PAD_LEFT);
+ $minute = str_pad((string) (((int) $minute) % static::MINUTES_PER_HOUR), 2, '0', STR_PAD_LEFT);
return "$symbol$hour$separator$minute";
}
@@ -2479,7 +2534,7 @@ trait Date
return 'millennia';
}
- return "${unit}s";
+ return "{$unit}s";
}
protected function executeCallable($macro, ...$parameters)
@@ -2566,7 +2621,7 @@ trait Date
if (str_starts_with($unit, 'is')) {
$word = substr($unit, 2);
- if (\in_array($word, static::$days)) {
+ if (\in_array($word, static::$days, true)) {
return $this->isDayOfWeek($word);
}
@@ -2594,7 +2649,7 @@ trait Date
$unit = strtolower(substr($unit, 3));
}
- if (\in_array($unit, static::$units)) {
+ if (\in_array($unit, static::$units, true)) {
return $this->setUnit($unit, ...$parameters);
}
@@ -2604,7 +2659,7 @@ trait Date
if (str_starts_with($unit, 'Real')) {
$unit = static::singularUnit(substr($unit, 4));
- return $this->{"${action}RealUnit"}($unit, ...$parameters);
+ return $this->{"{$action}RealUnit"}($unit, ...$parameters);
}
if (preg_match('/^(Month|Quarter|Year|Decade|Century|Centurie|Millennium|Millennia)s?(No|With|Without|WithNo)Overflow$/', $unit, $match)) {
@@ -2616,7 +2671,7 @@ trait Date
}
if (static::isModifiableUnit($unit)) {
- return $this->{"${action}Unit"}($unit, $parameters[0] ?? 1, $overflow);
+ return $this->{"{$action}Unit"}($unit, $this->getMagicParameter($parameters, 0, 'value', 1), $overflow);
}
$sixFirstLetters = substr($unit, 0, 6);
@@ -2655,7 +2710,11 @@ trait Date
try {
$unit = static::singularUnit(substr($method, 0, -5));
- return $this->range($parameters[0] ?? $this, $parameters[1] ?? 1, $unit);
+ return $this->range(
+ $this->getMagicParameter($parameters, 0, 'endDate', $this),
+ $this->getMagicParameter($parameters, 1, 'factor', 1),
+ $unit
+ );
} catch (InvalidArgumentException $exception) {
// Try macros
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php
index cce1d2c3..ab5b65d2 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php
@@ -83,9 +83,9 @@ trait Difference
*
* @return CarbonInterval
*/
- protected static function fixDiffInterval(DateInterval $diff, $absolute)
+ protected static function fixDiffInterval(DateInterval $diff, $absolute, array $skip = [])
{
- $diff = CarbonInterval::instance($diff);
+ $diff = CarbonInterval::instance($diff, $skip);
// Work-around for https://bugs.php.net/bug.php?id=77145
// @codeCoverageIgnoreStart
@@ -148,9 +148,9 @@ trait Difference
*
* @return CarbonInterval
*/
- public function diffAsCarbonInterval($date = null, $absolute = true)
+ public function diffAsCarbonInterval($date = null, $absolute = true, array $skip = [])
{
- return static::fixDiffInterval($this->diff($this->resolveCarbon($date), $absolute), $absolute);
+ return static::fixDiffInterval($this->diff($this->resolveCarbon($date), $absolute), $absolute, $skip);
}
/**
@@ -189,9 +189,21 @@ trait Difference
*/
public function diffInMonths($date = null, $absolute = true)
{
- $date = $this->resolveCarbon($date);
+ $date = $this->resolveCarbon($date)->avoidMutation()->tz($this->tz);
+
+ [$yearStart, $monthStart, $dayStart] = explode('-', $this->format('Y-m-dHisu'));
+ [$yearEnd, $monthEnd, $dayEnd] = explode('-', $date->format('Y-m-dHisu'));
+
+ $diff = (((int) $yearEnd) - ((int) $yearStart)) * static::MONTHS_PER_YEAR +
+ ((int) $monthEnd) - ((int) $monthStart);
+
+ if ($diff > 0) {
+ $diff -= ($dayStart > $dayEnd ? 1 : 0);
+ } elseif ($diff < 0) {
+ $diff += ($dayStart < $dayEnd ? 1 : 0);
+ }
- return $this->diffInYears($date, $absolute) * static::MONTHS_PER_YEAR + (int) $this->diff($date, $absolute)->format('%r%m');
+ return $absolute ? abs($diff) : $diff;
}
/**
@@ -286,9 +298,9 @@ trait Difference
*/
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);
}
/**
@@ -301,9 +313,9 @@ trait Difference
*/
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);
}
/**
@@ -472,7 +484,7 @@ trait Difference
*/
public function floatDiffInSeconds($date = null, $absolute = true)
{
- return $this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_SECOND;
+ return (float) ($this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_SECOND);
}
/**
@@ -830,8 +842,9 @@ trait Difference
$intSyntax = $intSyntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $intSyntax;
$parts = min(7, max(1, (int) $parts));
+ $skip = \is_array($syntax) ? ($syntax['skip'] ?? []) : [];
- return $this->diffAsCarbonInterval($other, false)
+ return $this->diffAsCarbonInterval($other, false, (array) $skip)
->setLocalTranslator($this->getLocalTranslator())
->forHumans($syntax, (bool) $short, $parts, $options ?? $this->localHumanDiffOptions ?? static::getHumanDiffOptions());
}
@@ -1161,7 +1174,7 @@ trait Difference
version_compare(PHP_VERSION, '8.1.0-dev', '<') &&
abs($interval->d - $daysDiff) === 1
) {
- $daysDiff = abs($interval->d);
+ $daysDiff = abs($interval->d); // @codeCoverageIgnore
}
return $daysDiff * $sign;
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php
index 4cd66b67..f069c280 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php
@@ -40,7 +40,7 @@ trait IntervalRounding
$unit = 'second';
if ($precision instanceof DateInterval) {
- $precision = (string) CarbonInterval::instance($precision);
+ $precision = (string) CarbonInterval::instance($precision, [], true);
}
if (\is_string($precision) && preg_match('/^\s*(?<precision>\d+)?\s*(?<unit>\w+)(?<other>\W.*)?$/', $precision, $match)) {
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php
index ddd2b4e9..46aff113 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php
@@ -23,12 +23,16 @@ use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Contracts\Translation\LocaleAwareInterface;
use Symfony\Contracts\Translation\TranslatorInterface as ContractsTranslatorInterface;
-if (!interface_exists('Symfony\\Component\\Translation\\TranslatorInterface')) {
+// @codeCoverageIgnoreStart
+if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') &&
+ !interface_exists('Symfony\\Component\\Translation\\TranslatorInterface')
+) {
class_alias(
'Symfony\\Contracts\\Translation\\TranslatorInterface',
'Symfony\\Component\\Translation\\TranslatorInterface'
);
}
+// @codeCoverageIgnoreEnd
/**
* Trait Localization.
@@ -355,6 +359,13 @@ trait Localization
$weekdays = $messages['weekdays'] ?? [];
$meridiem = $messages['meridiem'] ?? ['AM', 'PM'];
+ if (isset($messages['ordinal_words'])) {
+ $timeString = self::replaceOrdinalWords(
+ $timeString,
+ $key === 'from' ? array_flip($messages['ordinal_words']) : $messages['ordinal_words']
+ );
+ }
+
if ($key === 'from') {
foreach (['months', 'weekdays'] as $variable) {
$list = $messages[$variable.'_standalone'] ?? null;
@@ -454,7 +465,7 @@ trait Localization
}
}
- $this->setLocalTranslator($translator);
+ $this->localTranslator = $translator;
}
return $this;
@@ -555,17 +566,13 @@ trait Localization
public static function localeHasShortUnits($locale)
{
return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) {
- return $newLocale &&
- (
- ($y = static::translateWith($translator, 'y')) !== 'y' &&
- $y !== static::translateWith($translator, 'year')
- ) || (
- ($y = static::translateWith($translator, 'd')) !== 'd' &&
+ return ($newLocale && (($y = static::translateWith($translator, 'y')) !== 'y' && $y !== static::translateWith($translator, 'year'))) || (
+ ($y = static::translateWith($translator, 'd')) !== 'd' &&
$y !== static::translateWith($translator, 'day')
- ) || (
- ($y = static::translateWith($translator, 'h')) !== 'h' &&
+ ) || (
+ ($y = static::translateWith($translator, 'h')) !== 'h' &&
$y !== static::translateWith($translator, 'hour')
- );
+ );
});
}
@@ -734,7 +741,7 @@ trait Localization
}
if ($translator && !($translator instanceof LocaleAwareInterface || method_exists($translator, 'getLocale'))) {
- throw new NotLocaleAwareException($translator);
+ throw new NotLocaleAwareException($translator); // @codeCoverageIgnore
}
return $translator;
@@ -823,4 +830,11 @@ trait Localization
return $list;
}
+
+ private static function replaceOrdinalWords(string $timeString, array $ordinalWords): string
+ {
+ return preg_replace_callback('/(?<![a-z])[a-z]+(?![a-z])/i', function (array $match) use ($ordinalWords) {
+ return $ordinalWords[mb_strtolower($match[0])] ?? $match[0];
+ }, $timeString);
+ }
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php
new file mode 100644
index 00000000..310a44d0
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\Traits;
+
+/**
+ * Trait MagicParameter.
+ *
+ * Allows to retrieve parameter in magic calls by index or name.
+ */
+trait MagicParameter
+{
+ private function getMagicParameter(array $parameters, int $index, string $key, $default)
+ {
+ if (\array_key_exists($index, $parameters)) {
+ return $parameters[$index];
+ }
+
+ if (\array_key_exists($key, $parameters)) {
+ return $parameters[$key];
+ }
+
+ return $default;
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php
index 88b251df..58224545 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php
+++ b/data/web/inc/lib/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 @@ trait Mixin
{
$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 @@ trait Mixin
// 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;
});
}
}
@@ -151,22 +196,12 @@ trait Mixin
protected static function bindMacroContext($context, callable $callable)
{
static::$macroContextStack[] = $context;
- $exception = null;
- $result = null;
try {
- $result = $callable();
- } catch (Throwable $throwable) {
- $exception = $throwable;
+ return $callable();
+ } finally {
+ array_pop(static::$macroContextStack);
}
-
- array_pop(static::$macroContextStack);
-
- if ($exception) {
- throw $exception;
- }
-
- return $result;
}
/**
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php
index 164dbbd1..39343d8f 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php
@@ -75,7 +75,7 @@ trait Modifiers
*
* @param string|int|null $modifier
*
- * @return static
+ * @return static|false
*/
public function next($modifier = null)
{
@@ -157,7 +157,7 @@ trait Modifiers
*
* @param string|int|null $modifier
*
- * @return static
+ * @return static|false
*/
public function previous($modifier = null)
{
@@ -451,7 +451,7 @@ trait Modifiers
*
* @param string $modifier
*
- * @return static
+ * @return static|false
*/
public function change($modifier)
{
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php
index 0ddee8dd..48f97397 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Options.php
@@ -22,7 +22,7 @@ use Throwable;
*
* Depends on the following methods:
*
- * @method \Carbon\Carbon|\Carbon\CarbonImmutable shiftTimezone($timezone) Set the timezone
+ * @method static shiftTimezone($timezone) Set the timezone
*/
trait Options
{
@@ -422,7 +422,7 @@ trait Options
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,11 +437,11 @@ trait Options
*/
public function __debugInfo()
{
- $infos = array_filter(get_object_vars($this), function ($var) {
+ $infos = array_filter(get_object_vars($this), static function ($var) {
return $var;
});
- foreach (['dumpProperties', 'constructedObjectId'] as $property) {
+ foreach (['dumpProperties', 'constructedObjectId', 'constructed'] as $property) {
if (isset($infos[$property])) {
unset($infos[$property]);
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php
index 33062397..85ff5a71 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php
@@ -52,12 +52,11 @@ trait Rounding
'millisecond' => [1000, 'microsecond'],
];
$normalizedUnit = static::singularUnit($unit);
- $ranges = array_merge(static::getRangesByUnit(), [
+ $ranges = array_merge(static::getRangesByUnit($this->daysInMonth), [
// @call roundUnit
'microsecond' => [0, 999999],
]);
$factor = 1;
- $initialMonth = $this->month;
if ($normalizedUnit === 'week') {
$normalizedUnit = 'day';
@@ -77,12 +76,15 @@ trait Rounding
$found = false;
$fraction = 0;
$arguments = null;
+ $initialValue = null;
$factor = $this->year < 0 ? -1 : 1;
$changes = [];
+ $minimumInc = null;
foreach ($ranges as $unit => [$minimum, $maximum]) {
if ($normalizedUnit === $unit) {
$arguments = [$this->$unit, $minimum];
+ $initialValue = $this->$unit;
$fraction = $precision - floor($precision);
$found = true;
@@ -93,7 +95,23 @@ trait Rounding
$delta = $maximum + 1 - $minimum;
$factor /= $delta;
$fraction *= $delta;
- $arguments[0] += $this->$unit * $factor;
+ $inc = ($this->$unit - $minimum) * $factor;
+
+ if ($inc !== 0.0) {
+ $minimumInc = $minimumInc ?? ($arguments[0] / pow(2, 52));
+
+ // If value is still the same when adding a non-zero increment/decrement,
+ // it means precision got lost in the addition
+ if (abs($inc) < $minimumInc) {
+ $inc = $minimumInc * ($inc < 0 ? -1 : 1);
+ }
+
+ // If greater than $precision, assume precision loss caused an overflow
+ if ($function !== 'floor' || abs($arguments[0] + $inc - $initialValue) >= $precision) {
+ $arguments[0] += $inc;
+ }
+ }
+
$changes[$unit] = round(
$minimum + ($fraction ? $fraction * $function(($this->$unit - $minimum) / $fraction) : 0)
);
@@ -111,16 +129,13 @@ trait Rounding
$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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php
index eebc69bd..c1d5c5e1 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php
@@ -120,6 +120,8 @@ trait Serialization
/**
* Returns the list of properties to dump on serialize() called on.
*
+ * Only used by PHP < 7.4.
+ *
* @return array
*/
public function __sleep()
@@ -134,22 +136,70 @@ trait Serialization
return $properties;
}
+ /**
+ * Returns the values to dump on serialize() called on.
+ *
+ * Only used by PHP >= 7.4.
+ *
+ * @return array
+ */
+ public function __serialize(): array
+ {
+ // @codeCoverageIgnoreStart
+ if (isset($this->timezone_type, $this->timezone, $this->date)) {
+ return [
+ 'date' => $this->date ?? null,
+ 'timezone_type' => $this->timezone_type,
+ 'timezone' => $this->timezone ?? null,
+ ];
+ }
+ // @codeCoverageIgnoreEnd
+
+ $timezone = $this->getTimezone();
+ $export = [
+ 'date' => $this->format('Y-m-d H:i:s.u'),
+ 'timezone_type' => $timezone->getType(),
+ 'timezone' => $timezone->getName(),
+ ];
+
+ // @codeCoverageIgnoreStart
+ if (\extension_loaded('msgpack') && isset($this->constructedObjectId)) {
+ $export['dumpDateProperties'] = [
+ 'date' => $this->format('Y-m-d H:i:s.u'),
+ 'timezone' => serialize($this->timezone ?? null),
+ ];
+ }
+ // @codeCoverageIgnoreEnd
+
+ if ($this->localTranslator ?? null) {
+ $export['dumpLocale'] = $this->locale ?? null;
+ }
+
+ return $export;
+ }
+
/**
* Set locale if specified on unserialize() called.
*
+ * Only used by PHP < 7.4.
+ *
* @return void
*/
#[ReturnTypeWillChange]
public function __wakeup()
{
- if (get_parent_class() && method_exists(parent::class, '__wakeup')) {
+ if (parent::class && method_exists(parent::class, '__wakeup')) {
// @codeCoverageIgnoreStart
try {
parent::__wakeup();
} catch (Throwable $exception) {
- // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later.
- ['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties;
- parent::__construct($date, unserialize($timezone));
+ try {
+ // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later.
+ ['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties;
+ parent::__construct($date, unserialize($timezone));
+ } catch (Throwable $ignoredException) {
+ throw $exception;
+ }
}
// @codeCoverageIgnoreEnd
}
@@ -164,6 +214,38 @@ trait Serialization
$this->cleanupDumpProperties();
}
+ /**
+ * Set locale if specified on unserialize() called.
+ *
+ * Only used by PHP >= 7.4.
+ *
+ * @return void
+ */
+ public function __unserialize(array $data): void
+ {
+ // @codeCoverageIgnoreStart
+ try {
+ $this->__construct($data['date'] ?? null, $data['timezone'] ?? null);
+ } catch (Throwable $exception) {
+ if (!isset($data['dumpDateProperties']['date'], $data['dumpDateProperties']['timezone'])) {
+ throw $exception;
+ }
+
+ try {
+ // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later.
+ ['date' => $date, 'timezone' => $timezone] = $data['dumpDateProperties'];
+ $this->__construct($date, unserialize($timezone));
+ } catch (Throwable $ignoredException) {
+ throw $exception;
+ }
+ }
+ // @codeCoverageIgnoreEnd
+
+ if (isset($data['dumpLocale'])) {
+ $this->locale($data['dumpLocale']);
+ }
+ }
+
/**
* Prepare the object for JSON serialization.
*
@@ -207,11 +289,15 @@ trait Serialization
*/
public function cleanupDumpProperties()
{
- foreach ($this->dumpProperties as $property) {
- if (isset($this->$property)) {
- unset($this->$property);
+ // @codeCoverageIgnoreStart
+ if (PHP_VERSION < 8.2) {
+ foreach ($this->dumpProperties as $property) {
+ if (isset($this->$property)) {
+ unset($this->$property);
+ }
}
}
+ // @codeCoverageIgnoreEnd
return $this;
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php
index c86faa74..f23c72e8 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Test.php
@@ -28,7 +28,7 @@ trait Test
/**
* A test Carbon instance to be returned when now instances are created.
*
- * @var static
+ * @var Closure|static|null
*/
protected static $testNow;
@@ -59,15 +59,13 @@ trait Test
*
* /!\ Use this method for unit tests only.
*
- * @param Closure|static|string|false|null $testNow real or mock Carbon instance
+ * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
*/
public static function setTestNow($testNow = null)
{
- if ($testNow === false) {
- $testNow = null;
- }
-
- static::$testNow = \is_string($testNow) ? static::parse($testNow) : $testNow;
+ static::$testNow = $testNow instanceof self || $testNow instanceof Closure
+ ? $testNow
+ : static::make($testNow);
}
/**
@@ -87,7 +85,7 @@ trait Test
*
* /!\ Use this method for unit tests only.
*
- * @param Closure|static|string|false|null $testNow real or mock Carbon instance
+ * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
*/
public static function setTestNowAndTimezone($testNow = null, $tz = null)
{
@@ -121,16 +119,22 @@ trait Test
*
* /!\ Use this method for unit tests only.
*
- * @param Closure|static|string|false|null $testNow real or mock Carbon instance
- * @param Closure|null $callback
+ * @template T
+ *
+ * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance
+ * @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);
- $result = $callback();
- static::setTestNow();
+
+ try {
+ $result = $callback();
+ } finally {
+ static::setTestNow();
+ }
return $result;
}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php
index 2cb5c48d..88a465c9 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php
@@ -63,7 +63,7 @@ trait Timestamp
public static function createFromTimestampMsUTC($timestamp)
{
[$milliseconds, $microseconds] = self::getIntegerAndDecimalParts($timestamp, 3);
- $sign = $milliseconds < 0 || $milliseconds === 0.0 && $microseconds < 0 ? -1 : 1;
+ $sign = $milliseconds < 0 || ($milliseconds === 0.0 && $microseconds < 0) ? -1 : 1;
$milliseconds = abs($milliseconds);
$microseconds = $sign * abs($microseconds) + static::MICROSECONDS_PER_MILLISECOND * ($milliseconds % static::MILLISECONDS_PER_SECOND);
$seconds = $sign * floor($milliseconds / static::MILLISECONDS_PER_SECOND);
@@ -125,7 +125,7 @@ trait Timestamp
*/
public function getPreciseTimestamp($precision = 6)
{
- return round($this->rawFormat('Uu') / pow(10, 6 - $precision));
+ return round(((float) $this->rawFormat('Uu')) / pow(10, 6 - $precision));
}
/**
@@ -182,7 +182,7 @@ trait Timestamp
$integer = 0;
$decimal = 0;
- foreach (preg_split('`[^0-9.]+`', $numbers) as $chunk) {
+ foreach (preg_split('`[^\d.]+`', $numbers) as $chunk) {
[$integerPart, $decimalPart] = explode('.', "$chunk.");
$integer += (int) $integerPart;
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php
new file mode 100644
index 00000000..a81164f9
--- /dev/null
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * This file is part of the Carbon package.
+ *
+ * (c) Brian Nesbitt <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Carbon\Traits;
+
+use Closure;
+
+/**
+ * Trait ToStringFormat.
+ *
+ * Handle global format customization for string cast of the object.
+ */
+trait ToStringFormat
+{
+ /**
+ * Format to use for __toString method when type juggling occurs.
+ *
+ * @var string|Closure|null
+ */
+ protected static $toStringFormat;
+
+ /**
+ * Reset the format used to the default when type juggling a Carbon instance to a string
+ *
+ * @return void
+ */
+ public static function resetToStringFormat()
+ {
+ static::setToStringFormat(null);
+ }
+
+ /**
+ * @deprecated To avoid conflict between different third-party libraries, static setters should not be used.
+ * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and
+ * use other method or custom format passed to format() method if you need to dump another string
+ * format.
+ *
+ * Set the default format used when type juggling a Carbon instance to a string.
+ *
+ * @param string|Closure|null $format
+ *
+ * @return void
+ */
+ public static function setToStringFormat($format)
+ {
+ static::$toStringFormat = $format;
+ }
+}
diff --git a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php
index 2902a8b1..5be14ec7 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/Traits/Units.php
@@ -17,6 +17,7 @@ use Carbon\CarbonInterval;
use Carbon\Exceptions\UnitException;
use Closure;
use DateInterval;
+use DateMalformedStringException;
use ReturnTypeWillChange;
/**
@@ -60,8 +61,6 @@ trait Units
case 'millisecond':
return $this->addRealUnit('microsecond', $value * static::MICROSECONDS_PER_MILLISECOND);
- break;
-
// @call addRealUnit
case 'second':
break;
@@ -167,7 +166,7 @@ trait Units
'weekday',
];
- return \in_array($unit, $modifiableUnits) || \in_array($unit, static::$units);
+ return \in_array($unit, $modifiableUnits, true) || \in_array($unit, static::$units, true);
}
/**
@@ -199,7 +198,7 @@ trait Units
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) {
@@ -232,6 +231,8 @@ trait Units
*/
public function addUnit($unit, $value = 1, $overflow = null)
{
+ $originalArgs = \func_get_args();
+
$date = $this;
if (!is_numeric($value) || !(float) $value) {
@@ -264,7 +265,7 @@ trait Units
/** @var static $date */
$date = $date->addDays($sign);
- while (\in_array($date->dayOfWeek, $weekendDays)) {
+ while (\in_array($date->dayOfWeek, $weekendDays, true)) {
$date = $date->addDays($sign);
}
}
@@ -274,14 +275,14 @@ trait Units
}
$timeString = $date->toTimeString();
- } elseif ($canOverflow = \in_array($unit, [
+ } elseif ($canOverflow = (\in_array($unit, [
'month',
'year',
]) && ($overflow === false || (
$overflow === null &&
($ucUnit = ucfirst($unit).'s') &&
!($this->{'local'.$ucUnit.'Overflow'} ?? static::{'shouldOverflow'.$ucUnit}())
- ))) {
+ )))) {
$day = $date->day;
}
@@ -304,16 +305,21 @@ trait Units
$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) {
- throw new UnitException('Unable to add unit '.var_export(\func_get_args(), true));
+ throw new UnitException('Unable to add unit '.var_export($originalArgs, true));
}
return $date;
@@ -362,7 +368,7 @@ trait Units
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 @@ trait Units
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/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php
index ad36c670..ce6b2f90 100644
--- a/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php
+++ b/data/web/inc/lib/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php
@@ -66,7 +66,7 @@ class TranslatorImmutable extends Translator
/**
* @codeCoverageIgnore
*/
- public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory)
+ public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void
{
$this->disallowMutation(__METHOD__);
diff --git a/data/web/inc/lib/vendor/psr/clock/CHANGELOG.md b/data/web/inc/lib/vendor/psr/clock/CHANGELOG.md
new file mode 100644
index 00000000..3cd6b9b7
--- /dev/null
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/psr/clock/LICENSE b/data/web/inc/lib/vendor/psr/clock/LICENSE
new file mode 100644
index 00000000..be683421
--- /dev/null
+++ b/data/web/inc/lib/vendor/psr/clock/LICENSE
@@ -0,0 +1,19 @@
+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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/data/web/inc/lib/vendor/psr/clock/README.md b/data/web/inc/lib/vendor/psr/clock/README.md
new file mode 100644
index 00000000..6ca877ee
--- /dev/null
+++ b/data/web/inc/lib/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
+<?php
+
+use Psr\Clock\ClockInterface;
+
+class Foo
+{
+ private ClockInterface $clock;
+
+ public function __construct(ClockInterface $clock)
+ {
+ $this->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/data/web/inc/lib/vendor/psr/clock/composer.json b/data/web/inc/lib/vendor/psr/clock/composer.json
new file mode 100644
index 00000000..77992eda
--- /dev/null
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/psr/clock/src/ClockInterface.php b/data/web/inc/lib/vendor/psr/clock/src/ClockInterface.php
new file mode 100644
index 00000000..7b6d8d8a
--- /dev/null
+++ b/data/web/inc/lib/vendor/psr/clock/src/ClockInterface.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace Psr\Clock;
+
+use DateTimeImmutable;
+
+interface ClockInterface
+{
+ /**
+ * Returns the current time as a DateTimeImmutable Object
+ */
+ public function now(): DateTimeImmutable;
+}
diff --git a/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json b/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json
index 774200fd..c6d02d87 100644
--- a/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json
+++ b/data/web/inc/lib/vendor/symfony/deprecation-contracts/composer.json
@@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-main": "3.3-dev"
+ "dev-main": "3.4-dev"
},
"thanks": {
"name": "symfony/contracts",
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/LICENSE b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/LICENSE
index 4cd8bdd3..6e3afce6 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/LICENSE
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php
index b65c54a6..2e0b9694 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Mbstring.php
@@ -69,7 +69,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,7 +80,7 @@ final class Mbstring
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
{
- if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) {
+ if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) {
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
} else {
$fromEncoding = self::getEncoding($fromEncoding);
@@ -102,7 +102,7 @@ final class Mbstring
$fromEncoding = 'Windows-1252';
}
if ('UTF-8' !== $fromEncoding) {
- $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s);
+ $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s);
}
return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
@@ -113,7 +113,7 @@ final class Mbstring
$fromEncoding = 'UTF-8';
}
- return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
+ return iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
}
public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars)
@@ -130,7 +130,7 @@ final class Mbstring
public static function mb_decode_mimeheader($s)
{
- return \iconv_mime_decode($s, 2, self::$internalEncoding);
+ return iconv_mime_decode($s, 2, self::$internalEncoding);
}
public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
@@ -140,7 +140,7 @@ final class Mbstring
public static function mb_decode_numericentity($s, $convmap, $encoding = null)
{
- if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
+ if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
return null;
@@ -150,7 +150,7 @@ final class Mbstring
return false;
}
- if (null !== $encoding && !is_scalar($encoding)) {
+ if (null !== $encoding && !\is_scalar($encoding)) {
trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
return ''; // Instead of null (cf. mb_encode_numericentity).
@@ -166,10 +166,10 @@ final class Mbstring
if ('UTF-8' === $encoding) {
$encoding = null;
if (!preg_match('//u', $s)) {
- $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
+ $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
}
} else {
- $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
+ $s = iconv($encoding, 'UTF-8//IGNORE', $s);
}
$cnt = floor(\count($convmap) / 4) * 4;
@@ -195,12 +195,12 @@ final class Mbstring
return $s;
}
- return \iconv('UTF-8', $encoding.'//IGNORE', $s);
+ return iconv('UTF-8', $encoding.'//IGNORE', $s);
}
public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false)
{
- if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
+ if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
return null;
@@ -210,13 +210,13 @@ final class Mbstring
return false;
}
- if (null !== $encoding && !is_scalar($encoding)) {
+ if (null !== $encoding && !\is_scalar($encoding)) {
trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
return null; // Instead of '' (cf. mb_decode_numericentity).
}
- if (null !== $is_hex && !is_scalar($is_hex)) {
+ if (null !== $is_hex && !\is_scalar($is_hex)) {
trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING);
return null;
@@ -232,10 +232,10 @@ final class Mbstring
if ('UTF-8' === $encoding) {
$encoding = null;
if (!preg_match('//u', $s)) {
- $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
+ $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
}
} else {
- $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
+ $s = iconv($encoding, 'UTF-8//IGNORE', $s);
}
static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
@@ -265,7 +265,7 @@ final class Mbstring
return $result;
}
- return \iconv('UTF-8', $encoding.'//IGNORE', $result);
+ return iconv('UTF-8', $encoding.'//IGNORE', $result);
}
public static function mb_convert_case($s, $mode, $encoding = null)
@@ -280,10 +280,10 @@ final class Mbstring
if ('UTF-8' === $encoding) {
$encoding = null;
if (!preg_match('//u', $s)) {
- $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
+ $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
}
} else {
- $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
+ $s = iconv($encoding, 'UTF-8//IGNORE', $s);
}
if (\MB_CASE_TITLE == $mode) {
@@ -301,7 +301,11 @@ final class Mbstring
$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;
@@ -343,7 +347,7 @@ final class Mbstring
return $s;
}
- return \iconv('UTF-8', $encoding.'//IGNORE', $s);
+ return iconv('UTF-8', $encoding.'//IGNORE', $s);
}
public static function mb_internal_encoding($encoding = null)
@@ -354,7 +358,7 @@ final class Mbstring
$normalizedEncoding = self::getEncoding($encoding);
- if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) {
+ if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) {
self::$internalEncoding = $normalizedEncoding;
return true;
@@ -406,6 +410,12 @@ final class Mbstring
public static function mb_check_encoding($var = null, $encoding = null)
{
+ if (PHP_VERSION_ID < 70200 && \is_array($var)) {
+ trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING);
+
+ return null;
+ }
+
if (null === $encoding) {
if (null === $var) {
return false;
@@ -413,7 +423,21 @@ final class Mbstring
$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)
@@ -488,7 +512,7 @@ final class Mbstring
return \strlen($s);
}
- return @\iconv_strlen($s, $encoding);
+ return @iconv_strlen($s, $encoding);
}
public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null)
@@ -509,7 +533,7 @@ final class Mbstring
return 0;
}
- return \iconv_strpos($haystack, $needle, $offset, $encoding);
+ return iconv_strpos($haystack, $needle, $offset, $encoding);
}
public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null)
@@ -533,7 +557,7 @@ final class Mbstring
}
$pos = '' !== $needle || 80000 > \PHP_VERSION_ID
- ? \iconv_strrpos($haystack, $needle, $encoding)
+ ? iconv_strrpos($haystack, $needle, $encoding)
: self::mb_strlen($haystack, $encoding);
return false !== $pos ? $offset + $pos : false;
@@ -541,7 +565,7 @@ final class Mbstring
public static function mb_str_split($string, $split_length = 1, $encoding = null)
{
- if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) {
+ if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) {
trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING);
return null;
@@ -550,6 +574,7 @@ final class Mbstring
if (1 > $split_length = (int) $split_length) {
if (80000 > \PHP_VERSION_ID) {
trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
+
return false;
}
@@ -568,7 +593,7 @@ final class Mbstring
}
$rx .= '.{'.$split_length.'})/us';
- return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
+ return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
}
$result = [];
@@ -617,7 +642,7 @@ final class Mbstring
}
if ($start < 0) {
- $start = \iconv_strlen($s, $encoding) + $start;
+ $start = iconv_strlen($s, $encoding) + $start;
if ($start < 0) {
$start = 0;
}
@@ -626,19 +651,21 @@ final class Mbstring
if (null === $length) {
$length = 2147483647;
} elseif ($length < 0) {
- $length = \iconv_strlen($s, $encoding) + $length - $start;
+ $length = iconv_strlen($s, $encoding) + $length - $start;
if ($length < 0) {
return '';
}
}
- return (string) \iconv_substr($s, $start, $length, $encoding);
+ return (string) iconv_substr($s, $start, $length, $encoding);
}
public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
{
- $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);
}
@@ -657,7 +684,7 @@ final class Mbstring
$pos = strrpos($haystack, $needle);
} else {
$needle = self::mb_substr($needle, 0, 1, $encoding);
- $pos = \iconv_strrpos($haystack, $needle, $encoding);
+ $pos = iconv_strrpos($haystack, $needle, $encoding);
}
return self::getSubpart($pos, $part, $haystack, $encoding);
@@ -673,8 +700,11 @@ final class Mbstring
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);
}
@@ -736,12 +766,12 @@ final class Mbstring
$encoding = self::getEncoding($encoding);
if ('UTF-8' !== $encoding) {
- $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
+ $s = iconv($encoding, 'UTF-8//IGNORE', $s);
}
$s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
- return ($wide << 1) + \iconv_strlen($s, 'UTF-8');
+ return ($wide << 1) + iconv_strlen($s, 'UTF-8');
}
public static function mb_substr_count($haystack, $needle, $encoding = null)
@@ -797,6 +827,50 @@ final class Mbstring
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();
+ }
+
+ try {
+ $validEncoding = @self::mb_check_encoding('', $encoding);
+ } catch (\ValueError $e) {
+ throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
+ }
+
+ // BC for PHP 7.3 and lower
+ if (!$validEncoding) {
+ throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding));
+ }
+
+ 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);
+ }
+ }
+
private static function getSubpart($pos, $part, $haystack, $encoding)
{
if (false === $pos) {
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/README.md b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/README.md
index 4efb599d..478b40da 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/README.md
+++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/README.md
@@ -5,7 +5,7 @@ This component provides a partial, native PHP implementation for the
[Mbstring](https://php.net/mbstring) extension.
More information can be found in the
-[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
+[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
License
=======
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php
new file mode 100644
index 00000000..512bba0b
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php
@@ -0,0 +1,119 @@
+<?php
+
+return [
+ 'İ' => 'i̇',
+ 'µ' => 'μ',
+ 'ſ' => 's',
+ 'ͅ' => 'ι',
+ 'ς' => 'σ',
+ 'ϐ' => 'β',
+ 'ϑ' => 'θ',
+ 'ϕ' => 'φ',
+ 'ϖ' => 'π',
+ 'ϰ' => 'κ',
+ 'ϱ' => 'ρ',
+ 'ϵ' => 'ε',
+ 'ẛ' => 'ṡ',
+ 'ι' => 'ι',
+ 'ß' => 'ss',
+ 'ʼn' => 'ʼn',
+ 'ǰ' => 'ǰ',
+ 'ΐ' => 'ΐ',
+ 'ΰ' => 'ΰ',
+ 'և' => 'եւ',
+ 'ẖ' => 'ẖ',
+ 'ẗ' => 'ẗ',
+ 'ẘ' => 'ẘ',
+ 'ẙ' => 'ẙ',
+ 'ẚ' => 'aʾ',
+ 'ẞ' => 'ss',
+ 'ὐ' => 'ὐ',
+ 'ὒ' => 'ὒ',
+ 'ὔ' => 'ὔ',
+ 'ὖ' => 'ὖ',
+ 'ᾀ' => 'ἀι',
+ 'ᾁ' => 'ἁι',
+ 'ᾂ' => 'ἂι',
+ 'ᾃ' => 'ἃι',
+ 'ᾄ' => 'ἄι',
+ 'ᾅ' => 'ἅι',
+ 'ᾆ' => 'ἆι',
+ 'ᾇ' => 'ἇι',
+ 'ᾈ' => 'ἀι',
+ 'ᾉ' => 'ἁι',
+ 'ᾊ' => 'ἂι',
+ 'ᾋ' => 'ἃι',
+ 'ᾌ' => 'ἄι',
+ 'ᾍ' => 'ἅι',
+ 'ᾎ' => 'ἆι',
+ 'ᾏ' => 'ἇι',
+ 'ᾐ' => 'ἠι',
+ 'ᾑ' => 'ἡι',
+ 'ᾒ' => 'ἢι',
+ 'ᾓ' => 'ἣι',
+ 'ᾔ' => 'ἤι',
+ 'ᾕ' => 'ἥι',
+ 'ᾖ' => 'ἦι',
+ 'ᾗ' => 'ἧι',
+ 'ᾘ' => 'ἠι',
+ 'ᾙ' => 'ἡι',
+ 'ᾚ' => 'ἢι',
+ 'ᾛ' => 'ἣι',
+ 'ᾜ' => 'ἤι',
+ 'ᾝ' => 'ἥι',
+ 'ᾞ' => 'ἦι',
+ 'ᾟ' => 'ἧι',
+ 'ᾠ' => 'ὠι',
+ 'ᾡ' => 'ὡι',
+ 'ᾢ' => 'ὢι',
+ 'ᾣ' => 'ὣι',
+ 'ᾤ' => 'ὤι',
+ 'ᾥ' => 'ὥι',
+ 'ᾦ' => 'ὦι',
+ 'ᾧ' => 'ὧι',
+ 'ᾨ' => 'ὠι',
+ 'ᾩ' => 'ὡι',
+ 'ᾪ' => 'ὢι',
+ 'ᾫ' => 'ὣι',
+ 'ᾬ' => 'ὤι',
+ 'ᾭ' => 'ὥι',
+ 'ᾮ' => 'ὦι',
+ 'ᾯ' => 'ὧι',
+ 'ᾲ' => 'ὰι',
+ 'ᾳ' => 'αι',
+ 'ᾴ' => 'άι',
+ 'ᾶ' => 'ᾶ',
+ 'ᾷ' => 'ᾶι',
+ 'ᾼ' => 'αι',
+ 'ῂ' => 'ὴι',
+ 'ῃ' => 'ηι',
+ 'ῄ' => 'ήι',
+ 'ῆ' => 'ῆ',
+ 'ῇ' => 'ῆι',
+ 'ῌ' => 'ηι',
+ 'ῒ' => 'ῒ',
+ 'ῖ' => 'ῖ',
+ 'ῗ' => 'ῗ',
+ 'ῢ' => 'ῢ',
+ 'ῤ' => 'ῤ',
+ 'ῦ' => 'ῦ',
+ 'ῧ' => 'ῧ',
+ 'ῲ' => 'ὼι',
+ 'ῳ' => 'ωι',
+ 'ῴ' => 'ώι',
+ 'ῶ' => 'ῶ',
+ 'ῷ' => 'ῶι',
+ 'ῼ' => 'ωι',
+ 'ff' => 'ff',
+ 'fi' => 'fi',
+ 'fl' => 'fl',
+ 'ffi' => 'ffi',
+ 'ffl' => 'ffl',
+ 'ſt' => 'st',
+ 'st' => 'st',
+ 'ﬓ' => 'մն',
+ 'ﬔ' => 'մե',
+ 'ﬕ' => 'մի',
+ 'ﬖ' => 'վն',
+ 'ﬗ' => 'մխ',
+];
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap.php b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap.php
index 1fedd1f7..ecf1a035 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap.php
@@ -132,6 +132,10 @@ if (!function_exists('mb_str_split')) {
function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
}
+if (!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 (extension_loaded('mbstring')) {
return;
}
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap80.php b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap80.php
index 82f5ac4d..2f9fb5b4 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap80.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/bootstrap80.php
@@ -128,6 +128,10 @@ if (!function_exists('mb_str_split')) {
function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
}
+if (!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 (extension_loaded('mbstring')) {
return;
}
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json
index 1fa21ca1..bd99d4b9 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json
+++ b/data/web/inc/lib/vendor/symfony/polyfill-mbstring/composer.json
@@ -30,9 +30,6 @@
},
"minimum-stability": "dev",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/LICENSE b/data/web/inc/lib/vendor/symfony/polyfill-php80/LICENSE
index 5593b1d8..0ed3a246 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/LICENSE
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/polyfill-php80/Php80.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Php80.php
index 5fef5118..362dd1a9 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Php80.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Php80.php
@@ -100,6 +100,16 @@ final class Php80
public static function str_ends_with(string $haystack, string $needle): bool
{
- return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle)));
+ if ('' === $needle || $needle === $haystack) {
+ return true;
+ }
+
+ if ('' === $haystack) {
+ return false;
+ }
+
+ $needleLength = \strlen($needle);
+
+ return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
}
}
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/PhpToken.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/PhpToken.php
new file mode 100644
index 00000000..fe6e6910
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/PhpToken.php
@@ -0,0 +1,103 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Polyfill\Php80;
+
+/**
+ * @author Fedonyuk Anton <[email protected]>
+ *
+ * @internal
+ */
+class PhpToken implements \Stringable
+{
+ /**
+ * @var int
+ */
+ public $id;
+
+ /**
+ * @var string
+ */
+ public $text;
+
+ /**
+ * @var int
+ */
+ public $line;
+
+ /**
+ * @var int
+ */
+ public $pos;
+
+ public function __construct(int $id, string $text, int $line = -1, int $position = -1)
+ {
+ $this->id = $id;
+ $this->text = $text;
+ $this->line = $line;
+ $this->pos = $position;
+ }
+
+ public function getTokenName(): ?string
+ {
+ if ('UNKNOWN' === $name = token_name($this->id)) {
+ $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text;
+ }
+
+ return $name;
+ }
+
+ /**
+ * @param int|string|array $kind
+ */
+ public function is($kind): bool
+ {
+ foreach ((array) $kind as $value) {
+ if (\in_array($value, [$this->id, $this->text], true)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ public function isIgnorable(): bool
+ {
+ return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true);
+ }
+
+ public function __toString(): string
+ {
+ return (string) $this->text;
+ }
+
+ /**
+ * @return static[]
+ */
+ public static function tokenize(string $code, int $flags = 0): array
+ {
+ $line = 1;
+ $position = 0;
+ $tokens = token_get_all($code, $flags);
+ foreach ($tokens as $index => $token) {
+ if (\is_string($token)) {
+ $id = \ord($token);
+ $text = $token;
+ } else {
+ [$id, $text, $line] = $token;
+ }
+ $tokens[$index] = new static($id, $text, $line, $position);
+ $position += \strlen($text);
+ }
+
+ return $tokens;
+ }
+}
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/README.md b/data/web/inc/lib/vendor/symfony/polyfill-php80/README.md
index 10b8ee49..3816c559 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/README.md
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/README.md
@@ -3,12 +3,13 @@ Symfony Polyfill / Php80
This component provides features added to PHP 8.0 core:
-- `Stringable` interface
+- [`Stringable`](https://php.net/stringable) interface
- [`fdiv`](https://php.net/fdiv)
-- `ValueError` class
-- `UnhandledMatchError` class
+- [`ValueError`](https://php.net/valueerror) class
+- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class
- `FILTER_VALIDATE_BOOL` constant
- [`get_debug_type`](https://php.net/get_debug_type)
+- [`PhpToken`](https://php.net/phptoken) class
- [`preg_last_error_msg`](https://php.net/preg_last_error_msg)
- [`str_contains`](https://php.net/str_contains)
- [`str_starts_with`](https://php.net/str_starts_with)
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
index 7ea6d277..2b955423 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php
@@ -1,5 +1,14 @@
<?php
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
#[Attribute(Attribute::TARGET_CLASS)]
final class Attribute
{
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
new file mode 100644
index 00000000..bd1212f6
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php
@@ -0,0 +1,16 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) {
+ class PhpToken extends Symfony\Polyfill\Php80\PhpToken
+ {
+ }
+}
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
index 77e037cb..7c62d750 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
@@ -1,5 +1,14 @@
<?php
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
if (\PHP_VERSION_ID < 80000) {
interface Stringable
{
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
index 37937cbf..01c6c6c8 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php
@@ -1,5 +1,14 @@
<?php
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
if (\PHP_VERSION_ID < 80000) {
class UnhandledMatchError extends Error
{
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
index a3a9b88b..783dbc28 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
@@ -1,5 +1,14 @@
<?php
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
if (\PHP_VERSION_ID < 80000) {
class ValueError extends Error
{
diff --git a/data/web/inc/lib/vendor/symfony/polyfill-php80/composer.json b/data/web/inc/lib/vendor/symfony/polyfill-php80/composer.json
index 5fe679db..46ccde20 100644
--- a/data/web/inc/lib/vendor/symfony/polyfill-php80/composer.json
+++ b/data/web/inc/lib/vendor/symfony/polyfill-php80/composer.json
@@ -29,9 +29,6 @@
},
"minimum-stability": "dev",
"extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/.gitignore b/data/web/inc/lib/vendor/symfony/translation-contracts/.gitignore
deleted file mode 100644
index c49a5d8d..00000000
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-vendor/
-composer.lock
-phpunit.xml
diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/LICENSE b/data/web/inc/lib/vendor/symfony/translation-contracts/LICENSE
index 23584145..7536caea 100644
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/LICENSE
+++ b/data/web/inc/lib/vendor/symfony/translation-contracts/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2018-2021 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/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php
index 6923b977..db40ba13 100644
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/LocaleAwareInterface.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation-contracts/README.md b/data/web/inc/lib/vendor/symfony/translation-contracts/README.md
index 42e5c517..b211d584 100644
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/README.md
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php
index c2c30a91..756228af 100644
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php
+++ b/data/web/inc/lib/vendor/symfony/translation-contracts/Test/TranslatorTest.php
@@ -30,7 +30,7 @@ use Symfony\Contracts\Translation\TranslatorTrait;
*/
class TranslatorTest extends TestCase
{
- private $defaultLocale;
+ private string $defaultLocale;
protected function setUp(): void
{
@@ -114,7 +114,7 @@ class TranslatorTest extends TestCase
$this->assertEquals('en', $translator->getLocale());
}
- public function getTransTests()
+ public static function getTransTests()
{
return [
['Symfony is great!', 'Symfony is great!', []],
@@ -122,7 +122,7 @@ class TranslatorTest extends TestCase
];
}
- 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 @@ class TranslatorTest extends TestCase
}
/**
- * @dataProvider getInternal
+ * @dataProvider getInterval
*/
public function testInterval($expected, $number, $interval)
{
@@ -146,7 +146,7 @@ class TranslatorTest extends TestCase
$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 @@ class TranslatorTest extends TestCase
*/
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 @@ class TranslatorTest extends TestCase
];
}
- 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 @@ class TranslatorTest extends TestCase
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 @@ class TranslatorTest extends TestCase
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 @@ class TranslatorTest extends TestCase
*
* 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 @@ class TranslatorTest extends TestCase
*
* @return array with nplural together with langcodes
*/
- public function failingLangcodes(): array
+ public static function failingLangcodes(): array
{
return [
['1', ['fa']],
@@ -356,7 +357,7 @@ class TranslatorTest extends TestCase
foreach ($matrix as $langCode => $data) {
$indexes = array_flip($data);
if ($expectSuccess) {
- $this->assertEquals($nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");
+ $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms.");
} else {
$this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");
}
diff --git a/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php b/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php
index 9c264bd2..e3b0adff 100644
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php
+++ b/data/web/inc/lib/vendor/symfony/translation-contracts/TranslatorTrait.php
@@ -23,24 +23,18 @@ 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
{
if (null === $id || '' === $id) {
@@ -140,121 +134,92 @@ EOF;
{
$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/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json b/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json
index 875242f6..213b5cda 100644
--- a/data/web/inc/lib/vendor/symfony/translation-contracts/composer.json
+++ b/data/web/inc/lib/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.4-dev"
},
"thanks": {
"name": "symfony/contracts",
diff --git a/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md b/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md
index 160b5e69..5f9098c0 100644
--- a/data/web/inc/lib/vendor/symfony/translation/CHANGELOG.md
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php b/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php
index 43a52fab..7dff58ff 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Catalogue/AbstractOperation.php
+++ b/data/web/inc/lib/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 @@ abstract class AbstractOperation implements OperationInterface
$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 @@ abstract class AbstractOperation implements OperationInterface
return $this->domains;
}
- /**
- * {@inheritdoc}
- */
public function getMessages(string $domain): array
{
if (!\in_array($domain, $this->getDomains())) {
@@ -116,9 +107,6 @@ abstract class AbstractOperation implements OperationInterface
return $this->messages[$domain][self::ALL_BATCH];
}
- /**
- * {@inheritdoc}
- */
public function getNewMessages(string $domain): array
{
if (!\in_array($domain, $this->getDomains())) {
@@ -132,9 +120,6 @@ abstract class AbstractOperation implements OperationInterface
return $this->messages[$domain][self::NEW_BATCH];
}
- /**
- * {@inheritdoc}
- */
public function getObsoleteMessages(string $domain): array
{
if (!\in_array($domain, $this->getDomains())) {
@@ -148,9 +133,6 @@ abstract class AbstractOperation implements OperationInterface
return $this->messages[$domain][self::OBSOLETE_BATCH];
}
- /**
- * {@inheritdoc}
- */
public function getResult(): MessageCatalogueInterface
{
foreach ($this->getDomains() as $domain) {
@@ -174,12 +156,12 @@ abstract class AbstractOperation implements OperationInterface
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 @@ abstract class AbstractOperation implements OperationInterface
* 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/data/web/inc/lib/vendor/symfony/translation/Catalogue/MergeOperation.php b/data/web/inc/lib/vendor/symfony/translation/Catalogue/MergeOperation.php
index 87db2fb0..1b777a84 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Catalogue/MergeOperation.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Catalogue/MergeOperation.php
@@ -25,7 +25,7 @@ use Symfony\Component\Translation\MessageCatalogueInterface;
class MergeOperation extends AbstractOperation
{
/**
- * {@inheritdoc}
+ * @return void
*/
protected function processDomain(string $domain)
{
@@ -36,6 +36,18 @@ class MergeOperation extends AbstractOperation
];
$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/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php b/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php
index 682b5752..2c0ec722 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Catalogue/TargetOperation.php
@@ -26,7 +26,7 @@ use Symfony\Component\Translation\MessageCatalogueInterface;
class TargetOperation extends AbstractOperation
{
/**
- * {@inheritdoc}
+ * @return void
*/
protected function processDomain(string $domain)
{
@@ -37,6 +37,18 @@ class TargetOperation extends AbstractOperation
];
$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/data/web/inc/lib/vendor/symfony/translation/CatalogueMetadataAwareInterface.php b/data/web/inc/lib/vendor/symfony/translation/CatalogueMetadataAwareInterface.php
new file mode 100644
index 00000000..c845959f
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/CatalogueMetadataAwareInterface.php
@@ -0,0 +1,48 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php
index 42513a8a..5d9c092c 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPullCommand.php
+++ b/data/web/inc/lib/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 @@ final class TranslationPullCommand extends Command
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 @@ final class TranslationPullCommand extends Command
}
}
- /**
- * {@inheritdoc}
- */
- protected function configure()
+ protected function configure(): void
{
$keys = $this->providerCollection->keys();
$defaultProvider = 1 === \count($keys) ? $keys[0] : null;
@@ -99,6 +95,7 @@ final class TranslationPullCommand extends Command
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 <info>%command.name%</> command pulls translations from the given provider. Only
@@ -120,9 +117,6 @@ EOF
;
}
- /**
- * {@inheritdoc}
- */
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
@@ -133,6 +127,7 @@ EOF
$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) {
@@ -141,7 +136,7 @@ EOF
switch ($format) {
case 'xlf20': $xliffVersion = '2.0';
- // no break
+ // no break
case 'xlf12': $format = 'xlf';
}
@@ -149,6 +144,8 @@ EOF
'path' => end($this->transPaths),
'xliff_version' => $xliffVersion,
'default_locale' => $this->defaultLocale,
+ 'as_tree' => (bool) $asTree,
+ 'inline' => $asTree,
];
if (!$domains) {
@@ -159,7 +156,7 @@ EOF
if ($force) {
foreach ($providerTranslations->getCatalogues() as $catalogue) {
- $operation = new TargetOperation((new MessageCatalogue($catalogue->getLocale())), $catalogue);
+ $operation = new TargetOperation(new MessageCatalogue($catalogue->getLocale()), $catalogue);
if ($intlIcu) {
$operation->moveMessagesToIntlDomainsIfPossible();
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php
index dba21643..1d04adbc 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Command/TranslationPushCommand.php
@@ -21,6 +21,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Translation\Provider\FilteringProvider;
use Symfony\Component\Translation\Provider\TranslationProviderCollection;
use Symfony\Component\Translation\Reader\TranslationReaderInterface;
use Symfony\Component\Translation\TranslatorBag;
@@ -33,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;
@@ -72,10 +73,7 @@ final class TranslationPushCommand extends Command
}
}
- /**
- * {@inheritdoc}
- */
- protected function configure()
+ protected function configure(): void
{
$keys = $this->providers->keys();
$defaultProvider = 1 === \count($keys) ? $keys[0] : null;
@@ -112,15 +110,12 @@ EOF
;
}
- /**
- * {@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);
@@ -129,6 +124,12 @@ EOF
$force = $input->getOption('force');
$deleteMissing = $input->getOption('delete-missing');
+ if (!$domains && $provider instanceof FilteringProvider) {
+ $domains = $provider->getDomains();
+ }
+
+ // Reading local translations must be done after retrieving the domains from the provider
+ // in order to manage only translations from configured domains
$localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths);
if (!$domains) {
diff --git a/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php b/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php
index f062fb79..ba946389 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Command/XliffLintCommand.php
+++ b/data/web/inc/lib/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(<<<EOF
The <info>%command.name%</info> command lints an XLIFF file and outputs to STDOUT
the first encountered syntax error.
@@ -109,7 +109,7 @@ EOF
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 @@ EOF
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 @@ EOF
// 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 @@ EOF
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 @@ EOF
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 @@ EOF
}
}
- 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 @@ EOF
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 @@ EOF
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/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
index 0f7901d5..d4f49cc6 100644
--- a/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
+++ b/data/web/inc/lib/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
@@ -25,17 +25,14 @@ use Symfony\Component\VarDumper\Cloner\Data;
*/
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 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
$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 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
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 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
/**
* @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 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
return $result;
}
- private function computeCount(array $messages)
+ private function computeCount(array $messages): array
{
$count = [
DataCollectorTranslator::MESSAGE_DEFINED => 0,
@@ -143,7 +131,7 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
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/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php b/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php
index 2a08b096..a2832ee8 100644
--- a/data/web/inc/lib/vendor/symfony/translation/DataCollectorTranslator.php
+++ b/data/web/inc/lib/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 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
$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 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
}
/**
- * {@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 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
}
/**
- * Passes through all unknown calls onto the translator object.
+ * @return mixed
*/
public function __call(string $method, array $args)
{
@@ -122,11 +105,9 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
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/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php
new file mode 100644
index 00000000..cdf63be4
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php
@@ -0,0 +1,36 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php
new file mode 100644
index 00000000..c21552f9
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php
@@ -0,0 +1,59 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php
index 4020a078..2ece6ac7 100644
--- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php
+++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php
@@ -20,6 +20,9 @@ use Symfony\Component\DependencyInjection\Reference;
*/
class TranslationDumperPass implements CompilerPassInterface
{
+ /**
+ * @return void
+ */
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('translation.writer')) {
diff --git a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php
index ee7c47ae..1baf9341 100644
--- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php
+++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php
@@ -21,6 +21,9 @@ use Symfony\Component\DependencyInjection\Reference;
*/
class TranslationExtractorPass implements CompilerPassInterface
{
+ /**
+ * @return void
+ */
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('translation.extractor')) {
diff --git a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php
index be79cdaf..dd6ea3c8 100644
--- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php
+++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPass.php
@@ -18,6 +18,9 @@ use Symfony\Component\DependencyInjection\Reference;
class TranslatorPass implements CompilerPassInterface
{
+ /**
+ * @return void
+ */
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('translator.default')) {
@@ -49,6 +52,23 @@ class TranslatorPass implements CompilerPassInterface
->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/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php
index b85c0662..1756e3c8 100644
--- a/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php
+++ b/data/web/inc/lib/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php
@@ -16,12 +16,15 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
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 <[email protected]>
*/
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 @@ class TranslatorPathsPass extends AbstractRecursivePass
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/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php
index 0bd3f5e0..8f547525 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/CsvFileDumper.php
@@ -23,9 +23,6 @@ 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+');
@@ -43,6 +40,8 @@ class CsvFileDumper extends FileDumper
/**
* Sets the delimiter and escape character for CSV.
+ *
+ * @return void
*/
public function setCsvControl(string $delimiter = ';', string $enclosure = '"')
{
@@ -50,9 +49,6 @@ class CsvFileDumper extends FileDumper
$this->enclosure = $enclosure;
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'csv';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/DumperInterface.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/DumperInterface.php
index 7cdaef51..6bf42931 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/DumperInterface.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php
index 6bad4ff3..e30d4770 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/FileDumper.php
+++ b/data/web/inc/lib/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 @@ abstract class FileDumper implements DumperInterface
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function dump(MessageCatalogue $messages, array $options = [])
{
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php
index b62ea153..72c1ec08 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/IcuResFileDumper.php
@@ -20,14 +20,8 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class IcuResFileDumper extends FileDumper
{
- /**
- * {@inheritdoc}
- */
protected $relativePathTemplate = '%domain%/%locale%.%extension%';
- /**
- * {@inheritdoc}
- */
public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string
{
$data = $indexes = $resources = '';
@@ -47,7 +41,7 @@ class IcuResFileDumper extends FileDumper
$data .= pack('V', \strlen($target))
.mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8')
.$this->writePadding($data)
- ;
+ ;
}
$resOffset = $this->getPosition($data);
@@ -56,7 +50,7 @@ class IcuResFileDumper extends FileDumper
.$indexes
.$this->writePadding($data)
.$resources
- ;
+ ;
$bundleTop = $this->getPosition($data);
@@ -89,14 +83,11 @@ class IcuResFileDumper extends FileDumper
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/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php
index 75032be1..6cbdef60 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/IniFileDumper.php
@@ -20,9 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class IniFileDumper extends FileDumper
{
- /**
- * {@inheritdoc}
- */
public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string
{
$output = '';
@@ -35,9 +32,6 @@ class IniFileDumper extends FileDumper
return $output;
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'ini';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php
index 11027303..e5035397 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/JsonFileDumper.php
@@ -20,9 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ class JsonFileDumper extends FileDumper
return json_encode($messages->all($domain), $flags);
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'json';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php
index 08c8f899..9ded5f4e 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/MoFileDumper.php
@@ -21,9 +21,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class MoFileDumper extends FileDumper
{
- /**
- * {@inheritdoc}
- */
public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string
{
$sources = $targets = $sourceOffsets = $targetOffsets = '';
@@ -57,19 +54,16 @@ class MoFileDumper extends FileDumper
.$this->writeLong($offset[2] + $sourcesStart + $sourcesSize);
}
- $output = implode('', array_map([$this, 'writeLong'], $header))
+ $output = implode('', array_map($this->writeLong(...), $header))
.$sourceOffsets
.$targetOffsets
.$sources
.$targets
- ;
+ ;
return $output;
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'mo';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php
index 565d8937..51e90665 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/PhpFileDumper.php
@@ -20,17 +20,11 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class PhpFileDumper extends FileDumper
{
- /**
- * {@inheritdoc}
- */
public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string
{
return "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n";
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'php';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php
index 313e5045..a2d0deb7 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/PoFileDumper.php
@@ -20,9 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class PoFileDumper extends FileDumper
{
- /**
- * {@inheritdoc}
- */
public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string
{
$output = 'msgid ""'."\n";
@@ -68,7 +65,7 @@ class PoFileDumper extends FileDumper
return $output;
}
- private function getStandardRules(string $id)
+ private function getStandardRules(string $id): array
{
// Partly copied from TranslatorTrait::trans.
$parts = [];
@@ -111,9 +108,6 @@ EOF;
return $standardRules;
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'po';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php
index 819409fc..0373e9c1 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/QtFileDumper.php
@@ -20,9 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ class QtFileDumper extends FileDumper
return $dom->saveXML();
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return 'ts';
diff --git a/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php
index b8a109a4..d0f016b2 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/XliffFileDumper.php
@@ -21,9 +21,11 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ class XliffFileDumper extends FileDumper
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 @@ class XliffFileDumper extends FileDumper
$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 @@ class XliffFileDumper extends FileDumper
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 @@ class XliffFileDumper extends FileDumper
$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 @@ class XliffFileDumper extends FileDumper
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/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php b/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php
index d0cfbefa..d2670331 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Dumper/YamlFileDumper.php
@@ -30,9 +30,6 @@ class YamlFileDumper extends FileDumper
$this->extension = $extension;
}
- /**
- * {@inheritdoc}
- */
public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string
{
if (!class_exists(Yaml::class)) {
@@ -52,9 +49,6 @@ class YamlFileDumper extends FileDumper
return Yaml::dump($data);
}
- /**
- * {@inheritdoc}
- */
protected function getExtension(): string
{
return $this->extension;
diff --git a/data/web/inc/lib/vendor/symfony/translation/Exception/IncompleteDsnException.php b/data/web/inc/lib/vendor/symfony/translation/Exception/IncompleteDsnException.php
index cb0ce027..b304bde0 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Exception/IncompleteDsnException.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Exception/IncompleteDsnException.php
@@ -13,7 +13,7 @@ namespace Symfony\Component\Translation\Exception;
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/data/web/inc/lib/vendor/symfony/translation/Exception/MissingRequiredOptionException.php b/data/web/inc/lib/vendor/symfony/translation/Exception/MissingRequiredOptionException.php
index 2b5f8080..46152e25 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Exception/MissingRequiredOptionException.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Exception/MissingRequiredOptionException.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Translation\Exception;
*/
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/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php b/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php
index 331ff758..f2981f58 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Exception/ProviderException.php
@@ -18,10 +18,10 @@ use Symfony\Contracts\HttpClient\ResponseInterface;
*/
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/data/web/inc/lib/vendor/symfony/translation/Exception/UnsupportedSchemeException.php b/data/web/inc/lib/vendor/symfony/translation/Exception/UnsupportedSchemeException.php
index 7fbaa8f0..8d329518 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Exception/UnsupportedSchemeException.php
+++ b/data/web/inc/lib/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 @@ class UnsupportedSchemeException extends LogicException
}
$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/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php
index e58e82f0..d36f7f38 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Extractor/ChainExtractor.php
+++ b/data/web/inc/lib/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 @@ class ChainExtractor implements ExtractorInterface
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setPrefix(string $prefix)
{
@@ -46,7 +48,7 @@ class ChainExtractor implements ExtractorInterface
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function extract(string|iterable $directory, MessageCatalogue $catalogue)
{
diff --git a/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php
index b76a7f20..642130af 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Extractor/ExtractorInterface.php
+++ b/data/web/inc/lib/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<string> $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/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpAstExtractor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpAstExtractor.php
new file mode 100644
index 00000000..06fc77de
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpAstExtractor.php
@@ -0,0 +1,85 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+final class PhpAstExtractor extends AbstractFileExtractor implements ExtractorInterface
+{
+ private Parser $parser;
+
+ public function __construct(
+ /**
+ * @param iterable<AbstractVisitor&NodeVisitor> $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/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php
index 1b86cc59..7ff27f7c 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php
+++ b/data/web/inc/lib/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 @@ use Symfony\Component\Translation\MessageCatalogue;
* PhpExtractor extracts translation messages from a PHP template.
*
* @author Michel Salib <[email protected]>
+ *
+ * @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 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setPrefix(string $prefix)
{
@@ -164,7 +168,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
/**
* 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 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
}
}
- private function skipMethodArgument(\Iterator $tokenIterator)
+ private function skipMethodArgument(\Iterator $tokenIterator): void
{
$openBraces = 0;
@@ -199,7 +203,7 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
* 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 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
/**
* Extracts trans message from PHP tokens.
+ *
+ * @return void
*/
protected function parseTokens(array $tokens, MessageCatalogue $catalog, string $filename)
{
@@ -314,9 +320,6 @@ class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
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/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php
index 7fbd37c6..2dfc1e38 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpStringTokenParser.php
+++ b/data/web/inc/lib/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 @@ namespace Symfony\Component\Translation\Extractor;
* 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 @@ class PhpStringTokenParser
* @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/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php
new file mode 100644
index 00000000..c3368961
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php
@@ -0,0 +1,135 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php
new file mode 100644
index 00000000..00fb9eed
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php
@@ -0,0 +1,112 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ *
+ * 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/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php
new file mode 100644
index 00000000..53a6981a
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php
@@ -0,0 +1,65 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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 = (string) $node->name;
+
+ if ('trans' === $name || 't' === $name) {
+ $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/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php
new file mode 100644
index 00000000..6bd8bb02
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php
@@ -0,0 +1,65 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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/data/web/inc/lib/vendor/symfony/translation/Formatter/IntlFormatter.php b/data/web/inc/lib/vendor/symfony/translation/Formatter/IntlFormatter.php
index f7f1c36a..e62de253 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Formatter/IntlFormatter.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Formatter/IntlFormatter.php
@@ -20,12 +20,9 @@ use Symfony\Component\Translation\Exception\LogicException;
*/
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 @@ class IntlFormatter implements IntlFormatterInterface
}
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/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php b/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php
index 68821b1d..d5255bdc 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Formatter/MessageFormatter.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/LICENSE b/data/web/inc/lib/vendor/symfony/translation/LICENSE
index 88bf75bb..0138f8f0 100644
--- a/data/web/inc/lib/vendor/symfony/translation/LICENSE
+++ b/data/web/inc/lib/vendor/symfony/translation/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2022 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/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php
index 35de9ef5..e63a7d05 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/ArrayLoader.php
@@ -20,9 +20,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
class ArrayLoader implements LoaderInterface
{
- /**
- * {@inheritdoc}
- */
public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue
{
$resource = $this->flatten($resource);
@@ -46,9 +43,11 @@ class ArrayLoader implements LoaderInterface
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/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php
index 76b00b15..7f2f96be 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/CsvFileLoader.php
@@ -24,9 +24,6 @@ class CsvFileLoader extends FileLoader
private string $enclosure = '"';
private string $escape = '\\';
- /**
- * {@inheritdoc}
- */
protected function loadResource(string $resource): array
{
$messages = [];
@@ -45,7 +42,7 @@ class CsvFileLoader extends FileLoader
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,6 +52,8 @@ class CsvFileLoader extends FileLoader
/**
* Sets the delimiter, enclosure, and escape character for CSV.
+ *
+ * @return void
*/
public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = '\\')
{
diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php
index e170d761..877c3bbc 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/FileLoader.php
@@ -21,9 +21,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ abstract class FileLoader extends ArrayLoader
$messages = $this->loadResource($resource);
// empty resource
- if (null === $messages) {
- $messages = [];
- }
+ $messages ??= [];
// not an array
if (!\is_array($messages)) {
diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php
index c3ca5fd0..76e4e7f0 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuDatFileLoader.php
@@ -23,9 +23,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ class IcuDatFileLoader extends IcuResFileLoader
try {
$rb = new \ResourceBundle($locale, $resource);
- } catch (\Exception $e) {
+ } catch (\Exception) {
$rb = null;
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php
index 54c48f81..949dd979 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/IcuResFileLoader.php
@@ -23,9 +23,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ class IcuResFileLoader implements LoaderInterface
try {
$rb = new \ResourceBundle($locale, $resource);
- } catch (\Exception $e) {
+ } catch (\Exception) {
$rb = null;
}
@@ -71,9 +68,9 @@ class IcuResFileLoader implements LoaderInterface
*
* @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/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php
index 04e294d1..3126896c 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/IniFileLoader.php
@@ -18,9 +18,6 @@ namespace Symfony\Component\Translation\Loader;
*/
class IniFileLoader extends FileLoader
{
- /**
- * {@inheritdoc}
- */
protected function loadResource(string $resource): array
{
return parse_ini_file($resource, true);
diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php
index 67a8d58e..385553ef 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/JsonFileLoader.php
@@ -20,9 +20,6 @@ use Symfony\Component\Translation\Exception\InvalidResourceException;
*/
class JsonFileLoader extends FileLoader
{
- /**
- * {@inheritdoc}
- */
protected function loadResource(string $resource): array
{
$messages = [];
@@ -42,19 +39,13 @@ class JsonFileLoader extends FileLoader
*/
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/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php
index b0c89138..8427c393 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/MoFileLoader.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php
index 6bc2a05f..541b6c83 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/PhpFileLoader.php
+++ b/data/web/inc/lib/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 @@ class PhpFileLoader extends FileLoader
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/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php
index 6df16148..620d9733 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/PoFileLoader.php
+++ b/data/web/inc/lib/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 @@ class PoFileLoader extends FileLoader
}
$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 @@ class PoFileLoader extends FileLoader
} 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 @@ class PoFileLoader extends FileLoader
* 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/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php
index 6d5582d6..235f85ee 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/QtFileLoader.php
@@ -25,9 +25,6 @@ use Symfony\Component\Translation\MessageCatalogue;
*/
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 @@ class QtFileLoader implements LoaderInterface
$domain
);
}
- $translation = $translation->nextSibling;
}
if (class_exists(FileResource::class)) {
diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php
index 670e1997..31b3251b 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/XliffFileLoader.php
@@ -28,9 +28,6 @@ use Symfony\Component\Translation\Util\XliffUtils;
*/
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 @@ class XliffFileLoader implements LoaderInterface
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 @@ class XliffFileLoader implements LoaderInterface
/**
* 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 @@ class XliffFileLoader implements LoaderInterface
$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,6 +112,10 @@ class XliffFileLoader implements LoaderInterface
continue;
}
+ if (isset($translation->target) && 'needs-translation' === (string) $translation->target->attributes()['state']) {
+ continue;
+ }
+
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
// If the xlf file has another encoding specified, try to convert it because
// simple_xml will always return utf-8 encoded values
@@ -144,7 +149,7 @@ class XliffFileLoader implements LoaderInterface
}
}
- 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 +195,7 @@ class XliffFileLoader implements LoaderInterface
/**
* 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 +204,7 @@ class XliffFileLoader implements LoaderInterface
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 +232,6 @@ class XliffFileLoader implements LoaderInterface
private function isXmlString(string $resource): bool
{
- return 0 === strpos($resource, '<?xml');
+ return str_starts_with($resource, '<?xml');
}
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php b/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php
index 5eccf99d..48e735d1 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Loader/YamlFileLoader.php
@@ -24,14 +24,11 @@ use Symfony\Component\Yaml\Yaml;
*/
class YamlFileLoader extends FileLoader
{
- private $yamlParser;
+ private YamlParser $yamlParser;
- /**
- * {@inheritdoc}
- */
protected function loadResource(string $resource): array
{
- if (null === $this->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/data/web/inc/lib/vendor/symfony/translation/LocaleSwitcher.php b/data/web/inc/lib/vendor/symfony/translation/LocaleSwitcher.php
new file mode 100644
index 00000000..c07809c5
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/translation/LocaleSwitcher.php
@@ -0,0 +1,78 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * 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 <[email protected]>
+ */
+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
+ {
+ if (class_exists(\Locale::class)) {
+ \Locale::setDefault($locale);
+ }
+ $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/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php b/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php
index 8c8441cd..4a560bd6 100644
--- a/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php
+++ b/data/web/inc/lib/vendor/symfony/translation/LoggingTranslator.php
@@ -21,8 +21,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
*/
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 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface,
$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 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface,
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setLocale(string $locale)
{
@@ -62,25 +59,16 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface,
$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 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface,
}
/**
- * Passes through all unknown calls onto the translator object.
+ * @return mixed
*/
public function __call(string $method, array $args)
{
@@ -109,11 +97,9 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface,
/**
* 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/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php
index 7aa27efd..d56f0439 100644
--- a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php
+++ b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogue.php
@@ -17,13 +17,14 @@ use Symfony\Component\Translation\Exception\LogicException;
/**
* @author Fabien Potencier <[email protected]>
*/
-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 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
$this->messages = $messages;
}
- /**
- * {@inheritdoc}
- */
public function getLocale(): string
{
return $this->locale;
}
- /**
- * {@inheritdoc}
- */
public function getDomains(): array
{
$domains = [];
@@ -60,10 +55,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
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 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
/**
- * {@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 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
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 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function replace(array $messages, string $domain = 'messages')
{
@@ -151,28 +134,23 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function add(array $messages, string $domain = 'messages')
{
- if (!isset($this->messages[$domain])) {
- $this->messages[$domain] = [];
- }
- $intlDomain = $domain;
- if (!str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) {
- $intlDomain .= self::INTL_DOMAIN_SUFFIX;
- }
+ $altDomain = str_ends_with($domain, self::INTL_DOMAIN_SUFFIX) ? substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)) : $domain.self::INTL_DOMAIN_SUFFIX;
foreach ($messages as $id => $message) {
- if (isset($this->messages[$intlDomain]) && \array_key_exists($id, $this->messages[$intlDomain])) {
- $this->messages[$intlDomain][$id] = $message;
- } else {
- $this->messages[$domain][$id] = $message;
- }
+ unset($this->messages[$altDomain][$id]);
+ $this->messages[$domain][$id] = $message;
+ }
+
+ if ([] === ($this->messages[$altDomain] ?? null)) {
+ unset($this->messages[$altDomain]);
}
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function addCatalogue(MessageCatalogueInterface $catalogue)
{
@@ -196,10 +174,15 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
$metadata = $catalogue->getMetadata('', '');
$this->addMetadata($metadata);
}
+
+ if ($catalogue instanceof CatalogueMetadataAwareInterface) {
+ $catalogueMetadata = $catalogue->getCatalogueMetadata('', '');
+ $this->addCatalogueMetadata($catalogueMetadata);
+ }
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function addFallbackCatalogue(MessageCatalogueInterface $catalogue)
{
@@ -230,33 +213,24 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
}
- /**
- * {@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) {
@@ -277,7 +251,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setMetadata(string $key, mixed $value, string $domain = 'messages')
{
@@ -285,7 +259,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function deleteMetadata(string $key = '', string $domain = 'messages')
{
@@ -298,12 +272,53 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
}
+ 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) {
@@ -311,4 +326,13 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
}
}
+
+ private function addCatalogueMetadata(array $values): void
+ {
+ foreach ($values as $domain => $keys) {
+ foreach ($keys as $key => $value) {
+ $this->setCatalogueMetadata($key, $value, $domain);
+ }
+ }
+ }
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php
index 75e3a2fa..fd0d26d7 100644
--- a/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php
+++ b/data/web/inc/lib/vendor/symfony/translation/MessageCatalogueInterface.php
@@ -36,10 +36,8 @@ interface MessageCatalogueInterface
* 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 @@ interface MessageCatalogueInterface
* @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 @@ interface MessageCatalogueInterface
*
* @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 @@ interface MessageCatalogueInterface
*
* @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 @@ interface MessageCatalogueInterface
* 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 @@ interface MessageCatalogueInterface
* 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 @@ interface MessageCatalogueInterface
/**
* Adds a resource for this collection.
+ *
+ * @return void
*/
public function addResource(ResourceInterface $resource);
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php b/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php
index 2eaaceb3..39e5326c 100644
--- a/data/web/inc/lib/vendor/symfony/translation/MetadataAwareInterface.php
+++ b/data/web/inc/lib/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 <[email protected]>
*/
@@ -31,6 +31,8 @@ interface MetadataAwareInterface
/**
* Adds metadata to a message domain.
+ *
+ * @return void
*/
public function setMetadata(string $key, mixed $value, string $domain = 'messages');
@@ -39,6 +41,8 @@ interface MetadataAwareInterface
*
* 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/data/web/inc/lib/vendor/symfony/translation/Provider/AbstractProviderFactory.php b/data/web/inc/lib/vendor/symfony/translation/Provider/AbstractProviderFactory.php
index 17442fde..f0c11d85 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Provider/AbstractProviderFactory.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Provider/AbstractProviderFactory.php
@@ -27,19 +27,11 @@ abstract class AbstractProviderFactory implements ProviderFactoryInterface
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/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php b/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php
index 0f74d17f..1d90e27f 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Provider/Dsn.php
+++ b/data/web/inc/lib/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 @@ final class Dsn
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/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php b/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php
index a43fedc7..d4465b9f 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Provider/FilteringProvider.php
@@ -21,7 +21,7 @@ use Symfony\Component\Translation\TranslatorBagInterface;
*/
class FilteringProvider implements ProviderInterface
{
- private $provider;
+ private ProviderInterface $provider;
private array $locales;
private array $domains;
@@ -37,9 +37,6 @@ class FilteringProvider implements ProviderInterface
return (string) $this->provider;
}
- /**
- * {@inheritdoc}
- */
public function write(TranslatorBagInterface $translatorBag): void
{
$this->provider->write($translatorBag);
diff --git a/data/web/inc/lib/vendor/symfony/translation/Provider/ProviderInterface.php b/data/web/inc/lib/vendor/symfony/translation/Provider/ProviderInterface.php
index a32193f2..0e47083b 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Provider/ProviderInterface.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Provider/ProviderInterface.php
@@ -14,10 +14,8 @@ namespace Symfony\Component\Translation\Provider;
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/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php b/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php
index 61ac641c..b917415b 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Provider/TranslationProviderCollection.php
@@ -21,7 +21,7 @@ final class TranslationProviderCollection
/**
* @var array<string, ProviderInterface>
*/
- private $providers;
+ private array $providers;
/**
* @param array<string, ProviderInterface> $providers
diff --git a/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php b/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php
index 1d10e0cc..f26909f5 100644
--- a/data/web/inc/lib/vendor/symfony/translation/PseudoLocalizationTranslator.php
+++ b/data/web/inc/lib/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 @@ final class PseudoLocalizationTranslator implements TranslatorInterface
$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 @@ final class PseudoLocalizationTranslator implements TranslatorInterface
return [[true, true, $originalTrans]];
}
- $html = mb_convert_encoding($originalTrans, 'HTML-ENTITIES', 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);
@@ -283,7 +280,7 @@ final class PseudoLocalizationTranslator implements TranslatorInterface
}
$visibleLength = $this->strlen($visibleText);
- $missingLength = (int) (ceil($visibleLength * $this->expansionFactor)) - $visibleLength;
+ $missingLength = (int) ceil($visibleLength * $this->expansionFactor) - $visibleLength;
if ($this->brackets) {
$missingLength -= 2;
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/README.md b/data/web/inc/lib/vendor/symfony/translation/README.md
index adda9a5b..32e4017b 100644
--- a/data/web/inc/lib/vendor/symfony/translation/README.md
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php b/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php
index bbc687e1..01408d4d 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReader.php
+++ b/data/web/inc/lib/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 @@ class TranslationReader implements TranslationReaderInterface
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function read(string $directory, MessageCatalogue $catalogue)
{
diff --git a/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReaderInterface.php b/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReaderInterface.php
index bc37204f..ea74dc23 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Reader/TranslationReaderInterface.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php b/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php
index a7691642..8064190d 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Resources/bin/translation-status.php
@@ -9,6 +9,10 @@
* file that was distributed with this source code.
*/
+if ('cli' !== \PHP_SAPI) {
+ throw new Exception('This script must be run from the command line.');
+}
+
$usageInstructions = <<<END
Usage instructions
@@ -83,19 +87,15 @@ foreach ($config['original_files'] as $originalFilePath) {
$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 = [];
@@ -118,7 +118,7 @@ function findTranslationFiles($originalFilePath, $localeToAnalyze)
return $translations;
}
-function calculateTranslationStatus($originalFilePath, $translationFilePaths)
+function calculateTranslationStatus($originalFilePath, $translationFilePaths): array
{
$translationStatus = [];
$allTranslationKeys = extractTranslationKeys($originalFilePath);
@@ -159,7 +159,7 @@ function extractLocaleFromFilePath($filePath)
return $parts[count($parts) - 2];
}
-function extractTranslationKeys($filePath)
+function extractTranslationKeys($filePath): array
{
$translationKeys = [];
$contents = new \SimpleXMLElement(file_get_contents($filePath));
diff --git a/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json b/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json
index 288f1630..24d4d119 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Resources/data/parents.json
+++ b/data/web/inc/lib/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",
@@ -54,6 +55,7 @@
"en_MS": "en_001",
"en_MT": "en_001",
"en_MU": "en_001",
+ "en_MV": "en_001",
"en_MW": "en_001",
"en_MY": "en_001",
"en_NA": "en_001",
@@ -116,6 +118,8 @@
"es_UY": "es_419",
"es_VE": "es_419",
"ff_Adlm": "root",
+ "hi_Latn": "en_IN",
+ "ks_Deva": "root",
"nb": "no",
"nn": "no",
"pa_Arab": "root",
diff --git a/data/web/inc/lib/vendor/symfony/translation/Resources/functions.php b/data/web/inc/lib/vendor/symfony/translation/Resources/functions.php
index 901d2f87..0d2a037a 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Resources/functions.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Resources/functions.php
@@ -15,7 +15,7 @@ if (!\function_exists(t::class)) {
/**
* @author Nate Wiebe <[email protected]>
*/
- 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/data/web/inc/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd b/data/web/inc/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd
similarity index 96%
rename from data/web/inc/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
rename to data/web/inc/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd
index dface628..1f38de72 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
+++ b/data/web/inc/lib/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
May-19-2004:
@@ -1646,20 +1645,21 @@ Jan-10-2006
</xsd:group>
<xsd:attributeGroup name="AttrGroup_TextContent">
<xsd:attribute name="id" type="xsd:string" use="required"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="xid" type="xsd:string" use="optional"/>
<xsd:attribute name="equiv-text" type="xsd:string" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:attributeGroup>
<!-- XLIFF Structure -->
<xsd:element name="xliff">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
- <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
<xsd:element ref="xlf:file"/>
</xsd:sequence>
<xsd:attribute name="version" type="xlf:AttrType_Version" use="required"/>
<xsd:attribute ref="xml:lang" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="file">
@@ -1672,14 +1672,16 @@ Jan-10-2006
<xsd:attribute name="source-language" type="xsd:language" use="required"/>
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="required"/>
<xsd:attribute name="tool-id" type="xsd:string" use="optional"/>
+ <xsd:attribute default="manual" name="tool" type="xsd:string" use="optional"/>
<xsd:attribute name="date" type="xsd:dateTime" use="optional"/>
<xsd:attribute ref="xml:space" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="category" type="xsd:string" use="optional"/>
<xsd:attribute name="target-language" type="xsd:language" use="optional"/>
<xsd:attribute name="product-name" type="xsd:string" use="optional"/>
<xsd:attribute name="product-version" type="xsd:string" use="optional"/>
<xsd:attribute name="build-num" type="xsd:string" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
<xsd:unique name="U_group_id">
<xsd:selector xpath=".//xlf:group"/>
@@ -1739,10 +1741,11 @@ Jan-10-2006
<xsd:element name="glossary" type="xlf:ElemType_ExternalReference"/>
<xsd:element name="reference" type="xlf:ElemType_ExternalReference"/>
<xsd:element ref="xlf:count-group"/>
+ <xsd:element ref="xlf:prop-group"/>
<xsd:element ref="xlf:note"/>
<xsd:element ref="xlf:tool"/>
</xsd:choice>
- <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
@@ -1791,6 +1794,7 @@ Jan-10-2006
<xsd:attribute name="process-name" type="xsd:string" use="required"/>
<xsd:attribute name="company-name" type="xsd:string" use="optional"/>
<xsd:attribute name="tool-id" type="xsd:string" use="optional"/>
+ <xsd:attribute name="tool" type="xsd:string" use="optional"/>
<xsd:attribute name="date" type="xsd:dateTime" use="optional"/>
<xsd:attribute name="job-id" type="xsd:string" use="optional"/>
<xsd:attribute name="contact-name" type="xsd:string" use="optional"/>
@@ -1838,16 +1842,34 @@ Jan-10-2006
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
+ <xsd:element name="prop-group">
+ <xsd:complexType>
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element ref="xlf:prop"/>
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="optional"/>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="prop">
+ <xsd:complexType>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="prop-type" type="xsd:string" use="required"/>
+ <xsd:attribute ref="xml:lang" use="optional"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ </xsd:element>
<xsd:element name="tool">
<xsd:complexType mixed="true">
<xsd:sequence>
- <xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="tool-id" type="xsd:string" use="required"/>
<xsd:attribute name="tool-name" type="xsd:string" use="required"/>
<xsd:attribute name="tool-version" type="xsd:string" use="optional"/>
<xsd:attribute name="tool-company" type="xsd:string" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="body">
@@ -1865,8 +1887,9 @@ Jan-10-2006
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:count-group"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:prop-group"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/>
- <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xsd:sequence>
<xsd:choice maxOccurs="unbounded">
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/>
@@ -1877,6 +1900,7 @@ Jan-10-2006
<xsd:attribute name="id" type="xsd:string" use="optional"/>
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
<xsd:attribute default="default" ref="xml:space" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
<xsd:attribute name="extradata" type="xsd:string" use="optional"/>
@@ -1901,7 +1925,7 @@ Jan-10-2006
<xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="charclass" type="xsd:string" use="optional"/>
<xsd:attribute default="no" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="trans-unit">
@@ -1913,10 +1937,11 @@ Jan-10-2006
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="xlf:context-group"/>
<xsd:element ref="xlf:count-group"/>
+ <xsd:element ref="xlf:prop-group"/>
<xsd:element ref="xlf:note"/>
<xsd:element ref="xlf:alt-trans"/>
</xsd:choice>
- <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/>
@@ -1924,6 +1949,7 @@ Jan-10-2006
<xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/>
<xsd:attribute default="default" ref="xml:space" use="optional"/>
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="phase-name" type="xsd:string" use="optional"/>
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
@@ -1947,7 +1973,7 @@ Jan-10-2006
<xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="charclass" type="xsd:string" use="optional"/>
<xsd:attribute default="yes" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
<xsd:unique name="U_tu_segsrc_mid">
<xsd:selector xpath="./xlf:seg-source/xlf:mrk"/>
@@ -1962,7 +1988,8 @@ Jan-10-2006
<xsd:complexType mixed="true">
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
<xsd:attribute ref="xml:lang" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
<xsd:unique name="U_source_bpt_rid">
<xsd:selector xpath=".//xlf:bpt"/>
@@ -1985,7 +2012,8 @@ Jan-10-2006
<xsd:complexType mixed="true">
<xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/>
<xsd:attribute ref="xml:lang" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
<xsd:unique name="U_segsrc_bpt_rid">
<xsd:selector xpath=".//xlf:bpt"/>
@@ -2011,6 +2039,8 @@ Jan-10-2006
<xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/>
<xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute ref="xml:lang" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
+ <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
<xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/>
<xsd:attribute name="font" type="xsd:string" use="optional"/>
@@ -2018,7 +2048,7 @@ Jan-10-2006
<xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute default="yes" name="equiv-trans" type="xlf:AttrType_YesNo" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
<xsd:unique name="U_target_bpt_rid">
<xsd:selector xpath=".//xlf:bpt"/>
@@ -2042,18 +2072,21 @@ Jan-10-2006
<xsd:sequence>
<xsd:element minOccurs="0" ref="xlf:source"/>
<xsd:element minOccurs="0" ref="xlf:seg-source"/>
- <xsd:element maxOccurs="1" ref="xlf:target"/>
+ <xsd:element maxOccurs="unbounded" ref="xlf:target"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:prop-group"/>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/>
- <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xsd:sequence>
<xsd:attribute name="match-quality" type="xsd:string" use="optional"/>
<xsd:attribute name="tool-id" type="xsd:string" use="optional"/>
+ <xsd:attribute name="tool" type="xsd:string" use="optional"/>
<xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute ref="xml:lang" use="optional"/>
<xsd:attribute name="origin" type="xsd:string" use="optional"/>
<xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/>
<xsd:attribute default="default" ref="xml:space" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
<xsd:attribute name="extradata" type="xsd:string" use="optional"/>
@@ -2070,7 +2103,7 @@ Jan-10-2006
<xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute default="proposal" name="alttranstype" type="xlf:AttrType_alttranstype" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
<xsd:unique name="U_at_segsrc_mid">
<xsd:selector xpath="./xlf:seg-source/xlf:mrk"/>
@@ -2089,20 +2122,22 @@ Jan-10-2006
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="xlf:context-group"/>
<xsd:element ref="xlf:count-group"/>
+ <xsd:element ref="xlf:prop-group"/>
<xsd:element ref="xlf:note"/>
<xsd:element ref="xlf:trans-unit"/>
</xsd:choice>
- <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="skip"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="required"/>
<xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/>
<xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/>
<xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
<xsd:attribute name="phase-name" type="xsd:string" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="bin-source">
@@ -2111,7 +2146,8 @@ Jan-10-2006
<xsd:element ref="xlf:internal-file"/>
<xsd:element ref="xlf:external-file"/>
</xsd:choice>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="bin-target">
@@ -2121,12 +2157,13 @@ Jan-10-2006
<xsd:element ref="xlf:external-file"/>
</xsd:choice>
<xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="optional"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
<xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/>
<xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/>
<xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/>
<xsd:attribute name="resname" type="xsd:string" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
<!-- Element for inline codes -->
@@ -2217,7 +2254,8 @@ Jan-10-2006
<xsd:attribute name="mtype" type="xlf:AttrType_mtype" use="required"/>
<xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/>
<xsd:attribute name="comment" type="xsd:string" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="strict"/>
+ <xsd:attribute name="ts" type="xsd:string" use="optional"/>
+ <xsd:anyAttribute namespace="##any" processContents="skip"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
diff --git a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php
index d6510e0d..95ffcb1e 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderFactoryTestCase.php
+++ b/data/web/inc/lib/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\Exception\UnsupportedSchemeException;
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 <[email protected]>
- *
- * @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<array{0: bool, 1: string}>
*/
- abstract public function supportsProvider(): iterable;
+ abstract public static function supportsProvider(): iterable;
/**
- * @return iterable<array{0: string, 1: string, 2: TransportInterface}>
+ * @return iterable<array{0: string, 1: string}>
*/
- abstract public function createProvider(): iterable;
+ abstract public static function createProvider(): iterable;
/**
* @return iterable<array{0: string, 1: string|null}>
*/
- public function unsupportedSchemeProvider(): iterable
+ public static function unsupportedSchemeProvider(): iterable
{
return [];
}
@@ -60,7 +61,7 @@ abstract class ProviderFactoryTestCase extends TestCase
/**
* @return iterable<array{0: string, 1: string|null}>
*/
- public function incompleteDsnProvider(): iterable
+ public static function incompleteDsnProvider(): iterable
{
return [];
}
@@ -89,7 +90,7 @@ abstract class ProviderFactoryTestCase extends TestCase
/**
* @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 @@ abstract class ProviderFactoryTestCase extends TestCase
/**
* @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 @@ abstract class ProviderFactoryTestCase extends TestCase
{
return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class);
}
+
+ protected function getTranslatorBag(): TranslatorBagInterface
+ {
+ return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class);
+ }
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php b/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php
index 5ae26829..a8fa0b8b 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Test/ProviderTestCase.php
+++ b/data/web/inc/lib/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 <[email protected]>
- *
- * @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<array{0: string, 1: ProviderInterface}>
+ * @return iterable<array{0: ProviderInterface, 1: string}>
*/
- abstract public function toStringProvider(): iterable;
+ abstract public static function toStringProvider(): iterable;
/**
* @dataProvider toStringProvider
@@ -73,4 +74,9 @@ abstract class ProviderTestCase extends TestCase
{
return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class);
}
+
+ protected function getTranslatorBag(): TranslatorBagInterface
+ {
+ return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class);
+ }
}
diff --git a/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php b/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php
index b1a3b6b1..c591e68c 100644
--- a/data/web/inc/lib/vendor/symfony/translation/TranslatableMessage.php
+++ b/data/web/inc/lib/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 @@ class TranslatableMessage implements TranslatableInterface
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/data/web/inc/lib/vendor/symfony/translation/Translator.php b/data/web/inc/lib/vendor/symfony/translation/Translator.php
index 05e84d0c..1973d079 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Translator.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Translator.php
@@ -22,6 +22,7 @@ use Symfony\Component\Translation\Formatter\MessageFormatter;
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 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
* 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 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
* @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 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setLocale(string $locale)
{
@@ -133,9 +135,6 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
$this->locale = $locale;
}
- /**
- * {@inheritdoc}
- */
public function getLocale(): string
{
return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en');
@@ -146,6 +145,8 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
*
* @param string[] $locales
*
+ * @return void
+ *
* @throws InvalidArgumentException If a locale contains invalid characters
*/
public function setFallbackLocales(array $locales)
@@ -170,18 +171,13 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
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 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
}
}
+ $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 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
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 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
return $this->catalogues[$locale];
}
- /**
- * {@inheritdoc}
- */
public function getCatalogues(): array
{
return array_values($this->catalogues);
@@ -241,6 +233,9 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
return $this->loaders;
}
+ /**
+ * @return void
+ */
protected function loadCatalogue(string $locale)
{
if (null === $this->cacheDir) {
@@ -250,6 +245,9 @@ class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleA
}
}
+ /**
+ * @return void
+ */
protected function initializeCatalogue(string $locale)
{
$this->assertValidLocale($locale);
@@ -386,6 +384,9 @@ EOF
}
}
+ /**
+ * @return array
+ */
protected function computeFallbackLocales(string $locale)
{
$this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true);
@@ -430,6 +431,8 @@ EOF
/**
* 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/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php b/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php
index ffd109f1..3b47aece 100644
--- a/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php
+++ b/data/web/inc/lib/vendor/symfony/translation/TranslatorBag.php
@@ -35,10 +35,7 @@ final class TranslatorBag implements TranslatorBagInterface
}
}
- /**
- * {@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 @@ final class TranslatorBag implements TranslatorBagInterface
return $this->catalogues[$locale];
}
- /**
- * {@inheritdoc}
- */
public function getCatalogues(): array
{
return array_values($this->catalogues);
@@ -70,7 +64,7 @@ final class TranslatorBag implements TranslatorBagInterface
$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);
}
@@ -94,7 +88,10 @@ final class TranslatorBag implements TranslatorBagInterface
$obsoleteCatalogue = new MessageCatalogue($locale);
foreach ($operation->getDomains() as $domain) {
- $obsoleteCatalogue->add($operation->getObsoleteMessages($domain), $domain);
+ $obsoleteCatalogue->add(
+ array_diff($operation->getMessages($domain), $operation->getNewMessages($domain)),
+ $domain
+ );
}
$diff->addCatalogue($obsoleteCatalogue);
diff --git a/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php b/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php
index a787acf1..365d1f13 100644
--- a/data/web/inc/lib/vendor/symfony/translation/TranslatorBagInterface.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php b/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php
index 60b8be6e..64e15b48 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Util/ArrayConverter.php
@@ -36,7 +36,7 @@ class ArrayConverter
$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 @@ class ArrayConverter
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 @@ class ArrayConverter
$elem = &$elem[implode('.', \array_slice($parts, $i))];
break;
}
+
$parentOfElem = &$elem;
$elem = &$elem[$part];
}
@@ -82,7 +83,7 @@ class ArrayConverter
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 @@ class ArrayConverter
}
}
}
+
+ /**
+ * @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/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php b/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php
index 85ecc850..335c34be 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php
+++ b/data/web/inc/lib/vendor/symfony/translation/Util/XliffUtils.php
@@ -129,7 +129,7 @@ class XliffUtils
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/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php b/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php
index 5dd3a5c4..61e03cb0 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriter.php
+++ b/data/web/inc/lib/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 @@ class TranslationWriter implements 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/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriterInterface.php b/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriterInterface.php
index 43213097..5ebb9794 100644
--- a/data/web/inc/lib/vendor/symfony/translation/Writer/TranslationWriterInterface.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/translation/composer.json b/data/web/inc/lib/vendor/symfony/translation/composer.json
index abe8b972..af6f7a3d 100644
--- a/data/web/inc/lib/vendor/symfony/translation/composer.json
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md b/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md
index f58ed317..7481cff1 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/CHANGELOG.md
@@ -1,6 +1,25 @@
CHANGELOG
=========
+6.4
+---
+
+ * Dump uninitialized properties
+
+6.3
+---
+
+ * Add caster for `WeakMap`
+ * Add support of named arguments to `dd()` and `dump()` to display the argument name
+ * Add support for `Relay\Relay`
+ * Add display of invisible characters
+
+6.2
+---
+
+ * Add support for `FFI\CData` and `FFI\CType`
+ * Deprecate calling `VarDumper::setHandler()` without arguments
+
5.4
---
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/AmqpCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/AmqpCaster.php
index dc3b6219..22026f46 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/AmqpCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/AmqpCaster.php
@@ -46,6 +46,9 @@ class AmqpCaster
\AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS',
];
+ /**
+ * @return array
+ */
public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -79,6 +82,9 @@ class AmqpCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -102,6 +108,9 @@ class AmqpCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -125,6 +134,9 @@ class AmqpCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -153,6 +165,9 @@ class AmqpCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$prefix = Caster::PREFIX_VIRTUAL;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php
index a89a71b1..9dc24c1b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ArgsStub.php
@@ -28,7 +28,7 @@ class ArgsStub extends EnumStub
$values = [];
foreach ($args as $k => $v) {
- $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
+ $values[$k] = !\is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
}
if (null === $params) {
parent::__construct($values, false);
@@ -57,7 +57,7 @@ class ArgsStub extends EnumStub
try {
$r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function);
- } catch (\ReflectionException $e) {
+ } catch (\ReflectionException) {
return [null, null];
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php
index 53f4461d..d9577e7a 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/Caster.php
@@ -32,22 +32,27 @@ class Caster
public const EXCLUDE_EMPTY = 128;
public const EXCLUDE_NOT_IMPORTANT = 256;
public const EXCLUDE_STRICT = 512;
+ public const EXCLUDE_UNINITIALIZED = 1024;
public const PREFIX_VIRTUAL = "\0~\0";
public const PREFIX_DYNAMIC = "\0+\0";
public const PREFIX_PROTECTED = "\0*\0";
+ // usage: sprintf(Caster::PATTERN_PRIVATE, $class, $property)
+ public const PATTERN_PRIVATE = "\0%s\0%s";
+
+ private static array $classProperties = [];
/**
* Casts objects to arrays and adds the dynamic property prefix.
*
* @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 {
$debugInfo = $obj->__debugInfo();
- } catch (\Exception $e) {
+ } catch (\Throwable) {
// ignore failing __debugInfo()
$hasDebugInfo = false;
}
@@ -59,20 +64,17 @@ class Caster
return $a;
}
+ $classProperties = self::$classProperties[$class] ??= self::getClassProperties(new \ReflectionClass($class));
+ $a = array_replace($classProperties, $a);
+
if ($a) {
- static $publicProperties = [];
- $debugClass = $debugClass ?? get_debug_type($obj);
+ $debugClass ??= get_debug_type($obj);
$i = 0;
$prefixedKeys = [];
foreach ($a as $k => $v) {
if ("\0" !== ($k[0] ?? '')) {
- if (!isset($publicProperties[$class])) {
- foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) {
- $publicProperties[$class][$prop->name] = true;
- }
- }
- if (!isset($publicProperties[$class][$k])) {
+ if (!isset($classProperties[$k])) {
$prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k;
}
} elseif ($debugClass !== $class && 1 === strpos($k, $class)) {
@@ -115,7 +117,7 @@ class Caster
* @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
{
@@ -129,6 +131,8 @@ class Caster
$type |= self::EXCLUDE_EMPTY & $filter;
} elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) {
$type |= self::EXCLUDE_EMPTY & $filter;
+ } elseif ($v instanceof UninitializedStub) {
+ $type |= self::EXCLUDE_UNINITIALIZED & $filter;
}
if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) {
$type |= self::EXCLUDE_NOT_IMPORTANT;
@@ -167,4 +171,28 @@ class Caster
return $a;
}
+
+ private static function getClassProperties(\ReflectionClass $class): array
+ {
+ $classProperties = [];
+ $className = $class->name;
+
+ if ($parent = $class->getParentClass()) {
+ $classProperties += self::$classProperties[$parent->name] ??= self::getClassProperties($parent);
+ }
+
+ foreach ($class->getProperties() as $p) {
+ if ($p->isStatic()) {
+ continue;
+ }
+
+ $classProperties[match (true) {
+ $p->isPublic() => $p->name,
+ $p->isProtected() => self::PREFIX_PROTECTED.$p->name,
+ default => "\0".$className."\0".$p->name,
+ }] = new UninitializedStub($p);
+ }
+
+ return $classProperties;
+ }
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php
index 1ac6d0ac..91472866 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ClassStub.php
@@ -24,7 +24,7 @@ class ClassStub extends ConstStub
* @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name
* @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
*/
- public function __construct(string $identifier, callable|array|string $callable = null)
+ public function __construct(string $identifier, callable|array|string|null $callable = null)
{
$this->value = $identifier;
@@ -50,15 +50,13 @@ class ClassStub extends ConstStub
if (\is_array($r)) {
try {
$r = new \ReflectionMethod($r[0], $r[1]);
- } catch (\ReflectionException $e) {
+ } catch (\ReflectionException) {
$r = new \ReflectionClass($r[0]);
}
}
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) {
- return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
- }, $identifier);
+ $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]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $identifier);
}
if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) {
@@ -71,7 +69,7 @@ class ClassStub extends ConstStub
$this->value .= $s;
}
}
- } catch (\ReflectionException $e) {
+ } catch (\ReflectionException) {
return;
} finally {
if (0 < $i = strrpos($this->value, '\\')) {
@@ -87,6 +85,9 @@ class ClassStub extends ConstStub
}
}
+ /**
+ * @return mixed
+ */
public static function wrapCallable(mixed $callable)
{
if (\is_object($callable) || !\is_callable($callable)) {
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php
index d7d1812b..587c6c39 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ConstStub.php
@@ -20,7 +20,7 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class ConstStub extends Stub
{
- public function __construct(string $name, string|int|float $value = null)
+ public function __construct(string $name, string|int|float|null $value = null)
{
$this->class = $name;
$this->value = 1 < \func_num_args() ? $value : $name;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php
index b5a96a02..772399ef 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/CutStub.php
@@ -27,7 +27,7 @@ class CutStub extends Stub
switch (\gettype($value)) {
case 'object':
$this->type = self::TYPE_OBJECT;
- $this->class = \get_class($value);
+ $this->class = $value::class;
if ($value instanceof \Closure) {
ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DOMCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DOMCaster.php
index 4dd16e0e..d2d3fc12 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DOMCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DOMCaster.php
@@ -63,6 +63,9 @@ class DOMCaster
\XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
];
+ /**
+ * @return array
+ */
public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested)
{
$k = Caster::PREFIX_PROTECTED.'code';
@@ -73,6 +76,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castLength($dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -82,6 +88,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -92,6 +101,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -116,6 +128,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -132,6 +147,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$a += [
@@ -166,6 +184,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -176,6 +197,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -189,6 +213,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -199,6 +226,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -208,43 +238,9 @@ class DOMCaster
return $a;
}
- public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, bool $isNested)
- {
- $a += [
- 'typeName' => $dom->typeName,
- 'typeNamespace' => $dom->typeNamespace,
- ];
-
- return $a;
- }
-
- public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, bool $isNested)
- {
- $a += [
- 'severity' => $dom->severity,
- 'message' => $dom->message,
- 'type' => $dom->type,
- 'relatedException' => $dom->relatedException,
- 'related_data' => $dom->related_data,
- 'location' => $dom->location,
- ];
-
- return $a;
- }
-
- public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, bool $isNested)
- {
- $a += [
- 'lineNumber' => $dom->lineNumber,
- 'columnNumber' => $dom->columnNumber,
- 'offset' => $dom->offset,
- 'relatedNode' => $dom->relatedNode,
- 'uri' => $dom->uri ? new LinkStub($dom->uri, $dom->lineNumber) : $dom->uri,
- ];
-
- return $a;
- }
-
+ /**
+ * @return array
+ */
public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -259,6 +255,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -269,6 +268,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -283,6 +285,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -293,6 +298,9 @@ class DOMCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested)
{
$a += [
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php
index 99f53849..a0cbddb7 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DateCaster.php
@@ -24,11 +24,14 @@ class DateCaster
{
private const PERIOD_LIMIT = 3;
+ /**
+ * @return array
+ */
public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter)
{
$prefix = Caster::PREFIX_VIRTUAL;
- $location = $d->getTimezone()->getLocation();
- $fromNow = (new \DateTime())->diff($d);
+ $location = $d->getTimezone() ? $d->getTimezone()->getLocation() : null;
+ $fromNow = (new \DateTimeImmutable())->diff($d);
$title = $d->format('l, F j, Y')
."\n".self::formatInterval($fromNow).' from now'
@@ -47,6 +50,9 @@ class DateCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter)
{
$now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
@@ -76,10 +82,13 @@ class DateCaster
return $i->format(rtrim($format));
}
+ /**
+ * @return array
+ */
public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter)
{
$location = $timeZone->getLocation();
- $formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P');
+ $formatted = (new \DateTimeImmutable('now', $timeZone))->format($location ? 'e (P)' : 'P');
$title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : '';
$z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)];
@@ -87,6 +96,9 @@ class DateCaster
return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a;
}
+ /**
+ * @return array
+ */
public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter)
{
$dates = [];
@@ -103,11 +115,11 @@ class DateCaster
}
$period = sprintf(
- 'every %s, from %s (%s) %s',
+ 'every %s, from %s%s %s',
self::formatInterval($p->getDateInterval()),
+ $p->include_start_date ? '[' : ']',
self::formatDateTime($p->getStartDate()),
- $p->include_start_date ? 'included' : 'excluded',
- ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end) : 'recurring '.$p->recurrences.' time/s'
+ ($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end).(\PHP_VERSION_ID >= 80200 && $p->include_end_date ? ']' : '[') : 'recurring '.$p->recurrences.' time/s'
);
$p = [Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))];
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DoctrineCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
index 129b2cb4..3120c3d9 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
@@ -25,6 +25,9 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class DoctrineCaster
{
+ /**
+ * @return array
+ */
public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested)
{
foreach (['__cloner__', '__initializer__'] as $k) {
@@ -37,6 +40,9 @@ class DoctrineCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested)
{
foreach (['_entityPersister', '_identifier'] as $k) {
@@ -49,6 +55,9 @@ class DoctrineCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested)
{
foreach (['snapshot', 'association', 'typeClass'] as $k) {
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php
index 22112af9..afa2727b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/DsPairStub.php
@@ -18,7 +18,7 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class DsPairStub extends Stub
{
- public function __construct(string|int $key, mixed $value)
+ public function __construct(mixed $key, mixed $value)
{
$this->value = [
Caster::PREFIX_VIRTUAL.'key' => $key,
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
index 8e517e07..02efb1b0 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\VarDumper\Caster;
+use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
use Symfony\Component\VarDumper\Cloner\Stub;
use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
@@ -46,16 +47,25 @@ class ExceptionCaster
private static array $framesCache = [];
+ /**
+ * @return array
+ */
public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter);
}
+ /**
+ * @return array
+ */
public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter);
}
+ /**
+ * @return array
+ */
public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested)
{
if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) {
@@ -65,6 +75,9 @@ class ExceptionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested)
{
$trace = Caster::PREFIX_VIRTUAL.'trace';
@@ -83,6 +96,9 @@ class ExceptionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested)
{
$sPrefix = "\0".SilencedErrorContext::class."\0";
@@ -110,6 +126,9 @@ class ExceptionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested)
{
if (!$isNested) {
@@ -184,6 +203,9 @@ class ExceptionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested)
{
if (!$isNested) {
@@ -267,6 +289,19 @@ class ExceptionCaster
return $a;
}
+ /**
+ * @return array
+ */
+ public static function castFlattenException(FlattenException $e, array $a, Stub $stub, bool $isNested)
+ {
+ if ($isNested) {
+ $k = sprintf(Caster::PATTERN_PRIVATE, FlattenException::class, 'traceAsString');
+ $a[$k] = new CutStub($a[$k]);
+ }
+
+ return $a;
+ }
+
private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array
{
if (isset($a[$xPrefix.'trace'])) {
@@ -285,12 +320,10 @@ class ExceptionCaster
if (empty($a[$xPrefix.'previous'])) {
unset($a[$xPrefix.'previous']);
}
- unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
+ unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message']);
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) {
- 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']);
+ $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]++/', fn ($m) => class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0], $a[Caster::PREFIX_PROTECTED.'message']);
}
if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) {
@@ -337,7 +370,7 @@ class ExceptionCaster
$stub->attr['file'] = $f;
$stub->attr['line'] = $caller->getStartLine();
}
- } catch (\ReflectionException $e) {
+ } catch (\ReflectionException) {
// ignore fake class/function
}
@@ -352,9 +385,7 @@ class ExceptionCaster
$pad = null;
for ($i = $srcContext << 1; $i >= 0; --$i) {
if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) {
- if (null === $pad) {
- $pad = $c;
- }
+ $pad ??= $c;
if ((' ' !== $c && "\t" !== $c) || $pad !== $c) {
break;
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FFICaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FFICaster.php
new file mode 100644
index 00000000..f1984eef
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FFICaster.php
@@ -0,0 +1,161 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarDumper\Caster;
+
+use FFI\CData;
+use FFI\CType;
+use Symfony\Component\VarDumper\Cloner\Stub;
+
+/**
+ * Casts FFI extension classes to array representation.
+ *
+ * @author Nesmeyanov Kirill <[email protected]>
+ */
+final class FFICaster
+{
+ /**
+ * In case of "char*" contains a string, the length of which depends on
+ * some other parameter, then during the generation of the string it is
+ * possible to go beyond the allowable memory area.
+ *
+ * This restriction serves to ensure that processing does not take
+ * up the entire allowable PHP memory limit.
+ */
+ private const MAX_STRING_LENGTH = 255;
+
+ public static function castCTypeOrCData(CData|CType $data, array $args, Stub $stub): array
+ {
+ if ($data instanceof CType) {
+ $type = $data;
+ $data = null;
+ } else {
+ $type = \FFI::typeof($data);
+ }
+
+ $stub->class = sprintf('%s<%s> size %d align %d', ($data ?? $type)::class, $type->getName(), $type->getSize(), $type->getAlignment());
+
+ return match ($type->getKind()) {
+ CType::TYPE_FLOAT,
+ CType::TYPE_DOUBLE,
+ \defined('\FFI\CType::TYPE_LONGDOUBLE') ? CType::TYPE_LONGDOUBLE : -1,
+ CType::TYPE_UINT8,
+ CType::TYPE_SINT8,
+ CType::TYPE_UINT16,
+ CType::TYPE_SINT16,
+ CType::TYPE_UINT32,
+ CType::TYPE_SINT32,
+ CType::TYPE_UINT64,
+ CType::TYPE_SINT64,
+ CType::TYPE_BOOL,
+ CType::TYPE_CHAR,
+ CType::TYPE_ENUM => null !== $data ? [Caster::PREFIX_VIRTUAL.'cdata' => $data->cdata] : [],
+ CType::TYPE_POINTER => self::castFFIPointer($stub, $type, $data),
+ CType::TYPE_STRUCT => self::castFFIStructLike($type, $data),
+ CType::TYPE_FUNC => self::castFFIFunction($stub, $type),
+ default => $args,
+ };
+ }
+
+ private static function castFFIFunction(Stub $stub, CType $type): array
+ {
+ $arguments = [];
+
+ for ($i = 0, $count = $type->getFuncParameterCount(); $i < $count; ++$i) {
+ $param = $type->getFuncParameterType($i);
+
+ $arguments[] = $param->getName();
+ }
+
+ $abi = match ($type->getFuncABI()) {
+ CType::ABI_DEFAULT,
+ CType::ABI_CDECL => '[cdecl]',
+ CType::ABI_FASTCALL => '[fastcall]',
+ CType::ABI_THISCALL => '[thiscall]',
+ CType::ABI_STDCALL => '[stdcall]',
+ CType::ABI_PASCAL => '[pascal]',
+ CType::ABI_REGISTER => '[register]',
+ CType::ABI_MS => '[ms]',
+ CType::ABI_SYSV => '[sysv]',
+ CType::ABI_VECTORCALL => '[vectorcall]',
+ default => '[unknown abi]'
+ };
+
+ $returnType = $type->getFuncReturnType();
+
+ $stub->class = $abi.' callable('.implode(', ', $arguments).'): '
+ .$returnType->getName();
+
+ return [Caster::PREFIX_VIRTUAL.'returnType' => $returnType];
+ }
+
+ private static function castFFIPointer(Stub $stub, CType $type, ?CData $data = null): array
+ {
+ $ptr = $type->getPointerType();
+
+ if (null === $data) {
+ return [Caster::PREFIX_VIRTUAL.'0' => $ptr];
+ }
+
+ return match ($ptr->getKind()) {
+ CType::TYPE_CHAR => [Caster::PREFIX_VIRTUAL.'cdata' => self::castFFIStringValue($data)],
+ CType::TYPE_FUNC => self::castFFIFunction($stub, $ptr),
+ default => [Caster::PREFIX_VIRTUAL.'cdata' => $data[0]],
+ };
+ }
+
+ private static function castFFIStringValue(CData $data): string|CutStub
+ {
+ $result = [];
+
+ for ($i = 0; $i < self::MAX_STRING_LENGTH; ++$i) {
+ $result[$i] = $data[$i];
+
+ if ("\0" === $result[$i]) {
+ return implode('', $result);
+ }
+ }
+
+ $string = implode('', $result);
+ $stub = new CutStub($string);
+ $stub->cut = -1;
+ $stub->value = $string;
+
+ return $stub;
+ }
+
+ private static function castFFIStructLike(CType $type, ?CData $data = null): array
+ {
+ $isUnion = ($type->getAttributes() & CType::ATTR_UNION) === CType::ATTR_UNION;
+
+ $result = [];
+
+ foreach ($type->getStructFieldNames() as $name) {
+ $field = $type->getStructFieldType($name);
+
+ // Retrieving the value of a field from a union containing
+ // a pointer is not a safe operation, because may contain
+ // incorrect data.
+ $isUnsafe = $isUnion && CType::TYPE_POINTER === $field->getKind();
+
+ if ($isUnsafe) {
+ $result[Caster::PREFIX_VIRTUAL.$name.'?'] = $field;
+ } elseif (null === $data) {
+ $result[Caster::PREFIX_VIRTUAL.$name] = $field;
+ } else {
+ $fieldName = $data->{$name} instanceof CData ? '' : $field->getName().' ';
+ $result[Caster::PREFIX_VIRTUAL.$fieldName.$name] = $data->{$name};
+ }
+ }
+
+ return $result;
+ }
+}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php
index c74a9e59..b797dbd6 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/FiberCaster.php
@@ -20,6 +20,9 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
final class FiberCaster
{
+ /**
+ * @return array
+ */
public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$prefix = Caster::PREFIX_VIRTUAL;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/IntlCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/IntlCaster.php
index 23b9d5da..a4590f4b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/IntlCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/IntlCaster.php
@@ -21,6 +21,9 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class IntlCaster
{
+ /**
+ * @return array
+ */
public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -31,6 +34,9 @@ class IntlCaster
return self::castError($c, $a);
}
+ /**
+ * @return array
+ */
public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$a += [
@@ -102,12 +108,15 @@ class IntlCaster
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
]
- ),
+ ),
];
return self::castError($c, $a);
}
+ /**
+ * @return array
+ */
public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -125,6 +134,9 @@ class IntlCaster
return self::castError($c, $a);
}
+ /**
+ * @return array
+ */
public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$a += [
@@ -142,6 +154,9 @@ class IntlCaster
return self::castError($c, $a);
}
+ /**
+ * @return array
+ */
public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$a += [
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php
index 36e0d3cb..4930436d 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/LinkStub.php
@@ -23,14 +23,11 @@ class LinkStub extends ConstStub
private static array $vendorRoots;
private static array $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;
- if (null === $href) {
- $href = $label;
- }
- if (!\is_string($href)) {
+ if (!\is_string($href ??= $label)) {
return;
}
if (str_starts_with($href, 'file://')) {
@@ -63,7 +60,7 @@ class LinkStub extends ConstStub
}
}
- private function getComposerRoot(string $file, bool &$inVendor)
+ private function getComposerRoot(string $file, bool &$inVendor): string|false
{
if (!isset(self::$vendorRoots)) {
self::$vendorRoots = [];
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php
index d6baa251..2f161e8c 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/MemcachedCaster.php
@@ -23,6 +23,9 @@ class MemcachedCaster
private static array $optionConstants;
private static array $defaultOptions;
+ /**
+ * @return array
+ */
public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -37,8 +40,8 @@ class MemcachedCaster
private static function getNonDefaultOptions(\Memcached $c): array
{
- self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions();
- self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
+ self::$defaultOptions ??= self::discoverDefaultOptions();
+ self::$optionConstants ??= self::getOptionConstants();
$nonDefaultOptions = [];
foreach (self::$optionConstants as $constantKey => $value) {
@@ -56,7 +59,7 @@ class MemcachedCaster
$defaultMemcached->addServer('127.0.0.1', 11211);
$defaultOptions = [];
- self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
+ self::$optionConstants ??= self::getOptionConstants();
foreach (self::$optionConstants as $constantKey => $value) {
$defaultOptions[$constantKey] = $defaultMemcached->getOption($value);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PdoCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PdoCaster.php
index 140473b5..d68eae21 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PdoCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PdoCaster.php
@@ -59,6 +59,9 @@ class PdoCaster
],
];
+ /**
+ * @return array
+ */
public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested)
{
$attr = [];
@@ -76,7 +79,7 @@ class PdoCaster
if ($v && isset($v[$attr[$k]])) {
$attr[$k] = new ConstStub($v[$attr[$k]], $attr[$k]);
}
- } catch (\Exception $e) {
+ } catch (\Exception) {
}
}
if (isset($attr[$k = 'STATEMENT_CLASS'][1])) {
@@ -108,6 +111,9 @@ class PdoCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PgSqlCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
index d8e5b525..0d8b3d91 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
@@ -69,6 +69,9 @@ class PgSqlCaster
'function' => \PGSQL_DIAG_SOURCE_FUNCTION,
];
+ /**
+ * @return array
+ */
public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested)
{
$a['seek position'] = pg_lo_tell($lo);
@@ -76,6 +79,9 @@ class PgSqlCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castLink($link, array $a, Stub $stub, bool $isNested)
{
$a['status'] = pg_connection_status($link);
@@ -108,6 +114,9 @@ class PgSqlCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castResult($result, array $a, Stub $stub, bool $isNested)
{
$a['num rows'] = pg_num_rows($result);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php
index e7120191..eb6c88db 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ProxyManagerCaster.php
@@ -21,6 +21,9 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class ProxyManagerCaster
{
+ /**
+ * @return array
+ */
public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested)
{
if ($parent = get_parent_class($c)) {
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php
index 80533639..fcaa1b76 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php
@@ -31,13 +31,16 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class RdKafkaCaster
{
+ /**
+ * @return array
+ */
public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
try {
$assignment = $c->getAssignment();
- } catch (RdKafkaException $e) {
+ } catch (RdKafkaException) {
$assignment = [];
}
@@ -51,6 +54,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -62,6 +68,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castTopicPartition(TopicPartition $c, array $a)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -75,6 +84,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -86,6 +98,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -97,6 +112,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -108,6 +126,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -121,6 +142,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested)
{
$a += iterator_to_array($c);
@@ -128,6 +152,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -140,6 +167,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -153,6 +183,9 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -166,13 +199,16 @@ class RdKafkaCaster
return $a;
}
+ /**
+ * @return array
+ */
private static function extractMetadata(KafkaConsumer|\RdKafka $c)
{
$prefix = Caster::PREFIX_VIRTUAL;
try {
$m = $c->getMetadata(true, null, 500);
- } catch (RdKafkaException $e) {
+ } catch (RdKafkaException) {
return [];
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php
index eac25a12..6ff04675 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/RedisCaster.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\VarDumper\Caster;
+use Relay\Relay;
use Symfony\Component\VarDumper\Cloner\Stub;
/**
@@ -23,15 +24,15 @@ use Symfony\Component\VarDumper\Cloner\Stub;
class RedisCaster
{
private const SERIALIZERS = [
- \Redis::SERIALIZER_NONE => 'NONE',
- \Redis::SERIALIZER_PHP => 'PHP',
+ 0 => 'NONE', // Redis::SERIALIZER_NONE
+ 1 => 'PHP', // Redis::SERIALIZER_PHP
2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY
];
private const MODES = [
- \Redis::ATOMIC => 'ATOMIC',
- \Redis::MULTI => 'MULTI',
- \Redis::PIPELINE => 'PIPELINE',
+ 0 => 'ATOMIC', // Redis::ATOMIC
+ 1 => 'MULTI', // Redis::MULTI
+ 2 => 'PIPELINE', // Redis::PIPELINE
];
private const COMPRESSION_MODES = [
@@ -46,7 +47,10 @@ class RedisCaster
\RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES',
];
- public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested)
+ /**
+ * @return array
+ */
+ public static function castRedis(\Redis|Relay $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -72,6 +76,9 @@ class RedisCaster
];
}
+ /**
+ * @return array
+ */
public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -84,6 +91,9 @@ class RedisCaster
];
}
+ /**
+ * @return array
+ */
public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -102,9 +112,9 @@ class RedisCaster
return $a;
}
- private static function getRedisOptions(\Redis|\RedisArray|\RedisCluster $redis, array $options = []): EnumStub
+ private static function getRedisOptions(\Redis|Relay|\RedisArray|\RedisCluster $redis, array $options = []): EnumStub
{
- $serializer = $redis->getOption(\Redis::OPT_SERIALIZER);
+ $serializer = $redis->getOption(\defined('Redis::OPT_SERIALIZER') ? \Redis::OPT_SERIALIZER : 1);
if (\is_array($serializer)) {
foreach ($serializer as &$v) {
if (isset(self::SERIALIZERS[$v])) {
@@ -136,11 +146,11 @@ class RedisCaster
}
$options += [
- 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0,
- 'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT),
+ 'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : Relay::OPT_TCP_KEEPALIVE,
+ 'READ_TIMEOUT' => $redis->getOption(\defined('Redis::OPT_READ_TIMEOUT') ? \Redis::OPT_READ_TIMEOUT : Relay::OPT_READ_TIMEOUT),
'COMPRESSION' => $compression,
'SERIALIZER' => $serializer,
- 'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX),
+ 'PREFIX' => $redis->getOption(\defined('Redis::OPT_PREFIX') ? \Redis::OPT_PREFIX : Relay::OPT_PREFIX),
'SCAN' => $retry,
];
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
index 86d439f2..4adb9bc9 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
@@ -35,6 +35,9 @@ class ReflectionCaster
'isVariadic' => 'isVariadic',
];
+ /**
+ * @return array
+ */
public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -71,6 +74,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function unsetClosureFileInfo(\Closure $c, array $a)
{
unset($a[Caster::PREFIX_VIRTUAL.'file'], $a[Caster::PREFIX_VIRTUAL.'line']);
@@ -78,12 +84,12 @@ class ReflectionCaster
return $a;
}
- public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested)
+ public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested): array
{
// Cannot create ReflectionGenerator based on a terminated Generator
try {
$reflectionGenerator = new \ReflectionGenerator($c);
- } catch (\Exception $e) {
+ } catch (\Exception) {
$a[Caster::PREFIX_VIRTUAL.'closed'] = true;
return $a;
@@ -92,6 +98,9 @@ class ReflectionCaster
return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested);
}
+ /**
+ * @return array
+ */
public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -114,6 +123,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested)
{
self::addMap($a, $c, [
@@ -124,6 +136,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -144,7 +159,7 @@ class ReflectionCaster
array_unshift($trace, [
'function' => 'yield',
'file' => $function->getExecutingFile(),
- 'line' => $function->getExecutingLine() - (int) (\PHP_VERSION_ID < 80100),
+ 'line' => $function->getExecutingLine(),
]);
$trace[] = $frame;
$a[$prefix.'trace'] = new TraceStub($trace, false, 0, -1, -1);
@@ -159,6 +174,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -190,6 +208,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -197,7 +218,7 @@ class ReflectionCaster
self::addMap($a, $c, [
'returnsReference' => 'returnsReference',
'returnType' => 'getReturnType',
- 'class' => 'getClosureScopeClass',
+ 'class' => \PHP_VERSION_ID >= 80111 ? 'getClosureCalledClass' : 'getClosureScopeClass',
'this' => 'getClosureThis',
]);
@@ -248,6 +269,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castClassConstant(\ReflectionClassConstant $c, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
@@ -258,6 +282,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
@@ -265,6 +292,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -292,19 +322,22 @@ class ReflectionCaster
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) {
unset($a[$prefix.'allowsNull']);
}
- } catch (\ReflectionException $e) {
+ } catch (\ReflectionException) {
}
}
return $a;
}
+ /**
+ * @return array
+ */
public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
@@ -315,6 +348,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId();
@@ -322,6 +358,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested)
{
self::addMap($a, $c, [
@@ -338,6 +377,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested)
{
self::addMap($a, $c, [
@@ -350,6 +392,9 @@ class ReflectionCaster
return $a;
}
+ /**
+ * @return string
+ */
public static function getSignature(array $a)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -402,7 +447,7 @@ class ReflectionCaster
return $signature;
}
- private static function addExtra(array &$a, \Reflector $c)
+ private static function addExtra(array &$a, \Reflector $c): void
{
$x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : [];
@@ -418,7 +463,7 @@ class ReflectionCaster
}
}
- private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
+ private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL): void
{
foreach ($map as $k => $m) {
if ('isDisabled' === $k) {
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php
index 4e597f86..f3bbf3be 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ResourceCaster.php
@@ -27,6 +27,9 @@ class ResourceCaster
return curl_getinfo($h);
}
+ /**
+ * @return array
+ */
public static function castDba($dba, array $a, Stub $stub, bool $isNested)
{
$list = dba_list();
@@ -35,12 +38,15 @@ class ResourceCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castProcess($process, array $a, Stub $stub, bool $isNested)
{
return proc_get_status($process);
}
- public static function castStream($stream, array $a, Stub $stub, bool $isNested)
+ public static function castStream($stream, array $a, Stub $stub, bool $isNested): array
{
$a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested);
if ($a['uri'] ?? false) {
@@ -50,11 +56,17 @@ class ResourceCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested)
{
return @stream_context_get_params($stream) ?: $a;
}
+ /**
+ * @return array
+ */
public static function castGd($gd, array $a, Stub $stub, bool $isNested)
{
$a['size'] = imagesx($gd).'x'.imagesy($gd);
@@ -63,15 +75,9 @@ class ResourceCaster
return $a;
}
- public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested)
- {
- $a['host'] = mysql_get_host_info($h);
- $a['protocol'] = mysql_get_proto_info($h);
- $a['server'] = mysql_get_server_info($h);
-
- return $a;
- }
-
+ /**
+ * @return array
+ */
public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested)
{
$stub->cut = -1;
@@ -86,7 +92,7 @@ class ResourceCaster
$a += [
'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])),
'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])),
- 'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']),
+ 'expiry' => new ConstStub(date(\DateTimeInterface::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']),
'fingerprint' => new EnumStub([
'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)),
'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)),
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ScalarStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ScalarStub.php
new file mode 100644
index 00000000..3bb1935b
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/ScalarStub.php
@@ -0,0 +1,27 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarDumper\Caster;
+
+use Symfony\Component\VarDumper\Cloner\Stub;
+
+/**
+ * Represents any arbitrary value.
+ *
+ * @author Alexandre Daubois <[email protected]>
+ */
+class ScalarStub extends Stub
+{
+ public function __construct(mixed $value)
+ {
+ $this->value = $value;
+ }
+}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php
index a51cace1..814d824d 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SplCaster.php
@@ -29,16 +29,25 @@ class SplCaster
\SplFileObject::READ_CSV => 'READ_CSV',
];
+ /**
+ * @return array
+ */
public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, bool $isNested)
{
return self::castSplArray($c, $a, $stub, $isNested);
}
+ /**
+ * @return array
+ */
public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested)
{
return self::castSplArray($c, $a, $stub, $isNested);
}
+ /**
+ * @return array
+ */
public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested)
{
$a += [
@@ -48,6 +57,9 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -63,6 +75,9 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool $isNested)
{
static $map = [
@@ -117,7 +132,7 @@ class SplCaster
foreach ($map as $key => $accessor) {
try {
$a[$prefix.$key] = $c->$accessor();
- } catch (\Exception $e) {
+ } catch (\Exception) {
}
}
@@ -139,6 +154,9 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, bool $isNested)
{
static $map = [
@@ -155,7 +173,7 @@ class SplCaster
foreach ($map as $key => $accessor) {
try {
$a[$prefix.$key] = $c->$accessor();
- } catch (\Exception $e) {
+ } catch (\Exception) {
}
}
@@ -176,6 +194,9 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested)
{
$storage = [];
@@ -184,10 +205,10 @@ class SplCaster
$clone = clone $c;
foreach ($clone as $obj) {
- $storage[] = [
+ $storage[] = new EnumStub([
'object' => $obj,
'info' => $clone->getInfo(),
- ];
+ ]);
}
$a += [
@@ -197,6 +218,9 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator();
@@ -204,6 +228,9 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'object'] = $c->get();
@@ -211,6 +238,27 @@ class SplCaster
return $a;
}
+ /**
+ * @return array
+ */
+ public static function castWeakMap(\WeakMap $c, array $a, Stub $stub, bool $isNested)
+ {
+ $map = [];
+
+ foreach (clone $c as $obj => $data) {
+ $map[] = new EnumStub([
+ 'object' => $obj,
+ 'data' => $data,
+ ]);
+ }
+
+ $a += [
+ Caster::PREFIX_VIRTUAL.'map' => $map,
+ ];
+
+ return $a;
+ }
+
private static function castSplArray(\ArrayObject|\ArrayIterator $c, array $a, Stub $stub, bool $isNested): array
{
$prefix = Caster::PREFIX_VIRTUAL;
@@ -218,10 +266,14 @@ class SplCaster
if (!($flags & \ArrayObject::STD_PROP_LIST)) {
$c->setFlags(\ArrayObject::STD_PROP_LIST);
- $a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class);
+ $a = Caster::castObject($c, $c::class, method_exists($c, '__debugInfo'), $stub->class);
$c->setFlags($flags);
}
+
+ 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/data/web/inc/lib/vendor/symfony/var-dumper/Caster/StubCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/StubCaster.php
index 32ead7c2..4b93ff76 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/StubCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/StubCaster.php
@@ -22,6 +22,9 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class StubCaster
{
+ /**
+ * @return array
+ */
public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested)
{
if ($isNested) {
@@ -43,11 +46,17 @@ class StubCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested)
{
return $isNested ? $c->preservedSubset : $a;
}
+ /**
+ * @return array
+ */
public static function cutInternals($obj, array $a, Stub $stub, bool $isNested)
{
if ($isNested) {
@@ -59,6 +68,9 @@ class StubCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested)
{
if ($isNested) {
@@ -81,4 +93,15 @@ class StubCaster
return $a;
}
+
+ /**
+ * @return array
+ */
+ public static function castScalar(ScalarStub $scalarStub, array $a, Stub $stub)
+ {
+ $stub->type = Stub::TYPE_SCALAR;
+ $stub->attr['value'] = $scalarStub->value;
+
+ return $a;
+ }
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
index 08428b92..ebc00f90 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
@@ -15,6 +15,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\VarDumper\Cloner\Stub;
+use Symfony\Component\VarExporter\Internal\LazyObjectState;
/**
* @final
@@ -30,6 +31,9 @@ class SymfonyCaster
'format' => 'getRequestFormat',
];
+ /**
+ * @return array
+ */
public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested)
{
$clone = null;
@@ -37,9 +41,7 @@ class SymfonyCaster
foreach (self::REQUEST_GETTERS as $prop => $getter) {
$key = Caster::PREFIX_PROTECTED.$prop;
if (\array_key_exists($key, $a) && null === $a[$key]) {
- if (null === $clone) {
- $clone = clone $request;
- }
+ $clone ??= clone $request;
$a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}();
}
}
@@ -47,9 +49,12 @@ class SymfonyCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castHttpClient($client, array $a, Stub $stub, bool $isNested)
{
- $multiKey = sprintf("\0%s\0multi", \get_class($client));
+ $multiKey = sprintf("\0%s\0multi", $client::class);
if (isset($a[$multiKey])) {
$a[$multiKey] = new CutStub($a[$multiKey]);
}
@@ -57,6 +62,9 @@ class SymfonyCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested)
{
$stub->cut += \count($a);
@@ -69,6 +77,37 @@ class SymfonyCaster
return $a;
}
+ /**
+ * @return array
+ */
+ public static function castLazyObjectState($state, array $a, Stub $stub, bool $isNested)
+ {
+ if (!$isNested) {
+ return $a;
+ }
+
+ $stub->cut += \count($a) - 1;
+
+ $instance = $a['realInstance'] ?? null;
+
+ $a = ['status' => new ConstStub(match ($a['status']) {
+ LazyObjectState::STATUS_INITIALIZED_FULL => 'INITIALIZED_FULL',
+ LazyObjectState::STATUS_INITIALIZED_PARTIAL => 'INITIALIZED_PARTIAL',
+ LazyObjectState::STATUS_UNINITIALIZED_FULL => 'UNINITIALIZED_FULL',
+ LazyObjectState::STATUS_UNINITIALIZED_PARTIAL => 'UNINITIALIZED_PARTIAL',
+ }, $a['status'])];
+
+ if ($instance) {
+ $a['realInstance'] = $instance;
+ --$stub->cut;
+ }
+
+ return $a;
+ }
+
+ /**
+ * @return array
+ */
public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'toBase58'] = $uuid->toBase58();
@@ -82,6 +121,9 @@ class SymfonyCaster
return $a;
}
+ /**
+ * @return array
+ */
public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'toBase58'] = $ulid->toBase58();
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/TraceStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/TraceStub.php
index 5eea1c87..d215d8db 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/TraceStub.php
+++ b/data/web/inc/lib/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/data/web/inc/lib/vendor/symfony/var-dumper/Caster/UninitializedStub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/UninitializedStub.php
new file mode 100644
index 00000000..a9bdd9b8
--- /dev/null
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/UninitializedStub.php
@@ -0,0 +1,25 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\VarDumper\Caster;
+
+/**
+ * Represents an uninitialized property.
+ *
+ * @author Nicolas Grekas <[email protected]>
+ */
+class UninitializedStub extends ConstStub
+{
+ public function __construct(\ReflectionProperty $property)
+ {
+ parent::__construct('?'.($property->hasType() ? ' '.$property->getType() : ''), 'Uninitialized property');
+ }
+}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
index 721513c5..1cfcf4dd 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
@@ -1,4 +1,5 @@
<?php
+
/*
* This file is part of the Symfony package.
*
@@ -42,6 +43,9 @@ class XmlReaderCaster
\XMLReader::XML_DECLARATION => 'XML_DECLARATION',
];
+ /**
+ * @return array
+ */
public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested)
{
try {
@@ -51,7 +55,7 @@ class XmlReaderCaster
'VALIDATE' => @$reader->getParserProperty(\XMLReader::VALIDATE),
'SUBST_ENTITIES' => @$reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
];
- } catch (\Error $e) {
+ } catch (\Error) {
$properties = [
'LOADDTD' => false,
'DEFAULTATTRS' => false,
@@ -81,6 +85,7 @@ class XmlReaderCaster
$info[$props]->cut = $count;
}
+ $a = Caster::filter($a, Caster::EXCLUDE_UNINITIALIZED, [], $count);
$info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count);
// +2 because hasValue and hasAttributes are always filtered
$stub->cut += $count + 2;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
index ba55fced..0cf42584 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
@@ -47,6 +47,9 @@ class XmlResourceCaster
\XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING',
];
+ /**
+ * @return array
+ */
public static function castXml($h, array $a, Stub $stub, bool $isNested)
{
$a['current_byte_index'] = xml_get_current_byte_index($h);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
index b835c033..fc330bae 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
@@ -28,6 +28,7 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\VarDumper\Caster\CutArrayStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castCutArray'],
'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'],
'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'],
+ 'Symfony\Component\VarDumper\Caster\ScalarStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castScalar'],
'Fiber' => ['Symfony\Component\VarDumper\Caster\FiberCaster', 'castFiber'],
@@ -66,9 +67,6 @@ abstract class AbstractCloner implements ClonerInterface
'DOMAttr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
'DOMElement' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
'DOMText' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
- 'DOMTypeinfo' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castTypeinfo'],
- 'DOMDomError' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDomError'],
- 'DOMLocator' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLocator'],
'DOMDocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
'DOMNotation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
'DOMEntity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
@@ -92,10 +90,12 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'],
'Symfony\Component\Uid\Ulid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUlid'],
'Symfony\Component\Uid\Uuid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUuid'],
+ 'Symfony\Component\VarExporter\Internal\LazyObjectState' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castLazyObjectState'],
'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'],
'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'],
'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'],
'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
+ 'Symfony\Component\ErrorHandler\Exception\FlattenException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFlattenException'],
'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'],
'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'],
@@ -127,9 +127,11 @@ abstract class AbstractCloner implements ClonerInterface
'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'],
'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'],
+ 'WeakMap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakMap'],
'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'],
'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'],
+ 'Relay\Relay' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'],
'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'],
'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'],
@@ -163,7 +165,6 @@ abstract class AbstractCloner implements ClonerInterface
'GdImage' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
':gd' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
- ':mysql link' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castMysqlLink'],
':pgsql large object' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLargeObject'],
':pgsql link' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
':pgsql link persistent' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
@@ -191,6 +192,9 @@ abstract class AbstractCloner implements ClonerInterface
'RdKafka\Topic' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopic'],
'RdKafka\TopicPartition' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicPartition'],
'RdKafka\TopicConf' => ['Symfony\Component\VarDumper\Caster\RdKafkaCaster', 'castTopicConf'],
+
+ 'FFI\CData' => ['Symfony\Component\VarDumper\Caster\FFICaster', 'castCTypeOrCData'],
+ 'FFI\CType' => ['Symfony\Component\VarDumper\Caster\FFICaster', 'castCTypeOrCData'],
];
protected $maxItems = 2500;
@@ -215,12 +219,9 @@ 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;
- }
- $this->addCasters($casters);
+ $this->addCasters($casters ?? static::$defaultCasters);
}
/**
@@ -232,6 +233,8 @@ abstract class AbstractCloner implements ClonerInterface
* see e.g. static::$defaultCasters.
*
* @param callable[] $casters A map of casters
+ *
+ * @return void
*/
public function addCasters(array $casters)
{
@@ -242,6 +245,8 @@ abstract class AbstractCloner implements ClonerInterface
/**
* Sets the maximum number of items to clone past the minimum depth in nested structures.
+ *
+ * @return void
*/
public function setMaxItems(int $maxItems)
{
@@ -250,6 +255,8 @@ abstract class AbstractCloner implements ClonerInterface
/**
* Sets the maximum cloned length for strings.
+ *
+ * @return void
*/
public function setMaxString(int $maxString)
{
@@ -259,6 +266,8 @@ abstract class AbstractCloner implements ClonerInterface
/**
* Sets the minimum tree depth where we are guaranteed to clone all the items. After this
* depth is reached, only setMaxItems items will be cloned.
+ *
+ * @return void
*/
public function setMinDepth(int $minDepth)
{
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php
index 6ecb883e..16f51b0c 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Data.php
@@ -17,7 +17,7 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
/**
* @author Nicolas Grekas <[email protected]>
*/
-class Data implements \ArrayAccess, \Countable, \IteratorAggregate
+class Data implements \ArrayAccess, \Countable, \IteratorAggregate, \Stringable
{
private array $data;
private int $position = 0;
@@ -121,6 +121,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
yield from $value;
}
+ /**
+ * @return mixed
+ */
public function __get(string $key)
{
if (null !== $data = $this->seek($key)) {
@@ -211,6 +214,11 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
return $data;
}
+ public function getContext(): array
+ {
+ return $this->context;
+ }
+
/**
* Seeks to a specific key in nested data structures.
*/
@@ -257,21 +265,21 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
/**
* Dumps data with a DumperInterface dumper.
+ *
+ * @return void
*/
public function dump(DumperInterface $dumper)
{
$refs = [0];
$cursor = new Cursor();
+ $cursor->hashType = -1;
+ $cursor->attr = $this->context[SourceContextProvider::class] ?? [];
+ $label = $this->context['label'] ?? '';
- if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) {
- $cursor->attr['if_links'] = true;
- $cursor->hashType = -1;
- $dumper->dumpScalar($cursor, 'default', '^');
- $cursor->attr = ['if_links' => true];
- $dumper->dumpScalar($cursor, 'default', ' ');
- $cursor->hashType = 0;
+ if ($cursor->attr || '' !== $label) {
+ $dumper->dumpScalar($cursor, 'label', $label);
}
-
+ $cursor->hashType = 0;
$this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]);
}
@@ -280,7 +288,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
*
* @param mixed $item A Stub object or the original value being dumped
*/
- private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item)
+ private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, mixed $item): void
{
$cursor->refIndex = 0;
$cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
@@ -362,6 +370,10 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
$dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut);
break;
+ case Stub::TYPE_SCALAR:
+ $dumper->dumpScalar($cursor, 'default', $item->attr['value']);
+ break;
+
default:
throw new \RuntimeException(sprintf('Unexpected Stub type: "%s".', $item->type));
}
@@ -402,7 +414,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
return $hashCut;
}
- private function getStub(mixed $item)
+ private function getStub(mixed $item): mixed
{
if (!$item || !\is_array($item)) {
return $item;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php
index 61d02d24..4c5b315b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/DumperInterface.php
@@ -20,6 +20,8 @@ interface DumperInterface
{
/**
* Dumps a scalar value.
+ *
+ * @return void
*/
public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value);
@@ -29,6 +31,8 @@ interface DumperInterface
* @param string $str The string being dumped
* @param bool $bin Whether $str is UTF-8 or binary encoded
* @param int $cut The number of characters $str has been cut by
+ *
+ * @return void
*/
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut);
@@ -38,6 +42,8 @@ interface DumperInterface
* @param int $type A Cursor::HASH_* const for the type of hash
* @param string|int|null $class The object class, resource type or array count
* @param bool $hasChild When the dump of the hash has child item
+ *
+ * @return void
*/
public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild);
@@ -48,6 +54,8 @@ interface DumperInterface
* @param string|int|null $class The object class, resource type or array count
* @param bool $hasChild When the dump of the hash has child item
* @param int $cut The number of items the hash has been cut by
+ *
+ * @return void
*/
public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut);
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php
index 1c5b8871..0c2a4b9d 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/Stub.php
@@ -23,6 +23,7 @@ class Stub
public const TYPE_ARRAY = 3;
public const TYPE_OBJECT = 4;
public const TYPE_RESOURCE = 5;
+ public const TYPE_SCALAR = 6;
public const STRING_BINARY = 1;
public const STRING_UTF8 = 2;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php
index 9afcc348..e168d0d3 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Cloner/VarCloner.php
@@ -16,12 +16,8 @@ namespace Symfony\Component\VarDumper\Cloner;
*/
class VarCloner extends AbstractCloner
{
- private static string $gid;
private static array $arrayCache = [];
- /**
- * {@inheritdoc}
- */
protected function doClone(mixed $var): array
{
$len = 1; // Length of $queue
@@ -44,7 +40,6 @@ class VarCloner extends AbstractCloner
$stub = null; // Stub capturing the main properties of an original item value
// or null if the original value is used directly
- $gid = self::$gid ??= md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable
$arrayStub = new Stub();
$arrayStub->type = Stub::TYPE_ARRAY;
$fromObjCast = false;
@@ -121,53 +116,15 @@ class VarCloner extends AbstractCloner
}
$stub = $arrayStub;
- if (\PHP_VERSION_ID >= 80100) {
- $stub->class = array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC;
- $a = $v;
- break;
- }
-
- $stub->class = Stub::ARRAY_INDEXED;
-
- $j = -1;
- foreach ($v as $gk => $gv) {
- if ($gk !== ++$j) {
- $stub->class = Stub::ARRAY_ASSOC;
- $a = $v;
- $a[$gid] = true;
- break;
- }
- }
-
- // Copies of $GLOBALS have very strange behavior,
- // let's detect them with some black magic
- if (isset($v[$gid])) {
- unset($v[$gid]);
- $a = [];
- foreach ($v as $gk => &$gv) {
- if ($v === $gv && !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()])) {
- unset($v);
- $v = new Stub();
- $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0];
- $v->handle = -1;
- $gv = &$a[$gk];
- $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] = &$gv;
- $gv = $v;
- }
-
- $a[$gk] = &$gv;
- }
- unset($gv);
- } else {
- $a = $v;
- }
+ $stub->class = array_is_list($v) ? Stub::ARRAY_INDEXED : Stub::ARRAY_ASSOC;
+ $a = $v;
break;
case \is_object($v):
if (empty($objRefs[$h = spl_object_id($v)])) {
$stub = new Stub();
$stub->type = Stub::TYPE_OBJECT;
- $stub->class = \get_class($v);
+ $stub->class = $v::class;
$stub->value = $v;
$stub->handle = $h;
$a = $this->castObject($stub, 0 < $i);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
index e3d5f1d1..4450fe98 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
@@ -26,7 +26,7 @@ use Symfony\Component\VarDumper\Dumper\CliDumper;
*/
class CliDescriptor implements DumpDescriptorInterface
{
- private $dumper;
+ private CliDumper $dumper;
private mixed $lastIdentifier = null;
public function __construct(CliDumper $dumper)
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
index 1c0d80a0..98f150a5 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
@@ -24,7 +24,7 @@ use Symfony\Component\VarDumper\Dumper\HtmlDumper;
*/
class HtmlDescriptor implements DumpDescriptorInterface
{
- private $dumper;
+ private HtmlDumper $dumper;
private bool $initialized = false;
public function __construct(HtmlDumper $dumper)
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php b/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
index 13dd475b..b64a884b 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Command/ServerDumpCommand.php
@@ -38,7 +38,7 @@ use Symfony\Component\VarDumper\Server\DumpServer;
#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')]
class ServerDumpCommand extends Command
{
- private $server;
+ private DumpServer $server;
/** @var DumpDescriptorInterface[] */
private array $descriptors;
@@ -54,7 +54,7 @@ class ServerDumpCommand extends Command
parent::__construct();
}
- protected function configure()
+ protected function configure(): void
{
$this
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', implode(', ', $this->getAvailableFormats())), 'cli')
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
index 6ac38083..53165ba6 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
@@ -26,12 +26,15 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
public const DUMP_COMMA_SEPARATOR = 4;
public const DUMP_TRAILING_COMMA = 8;
+ /** @var callable|resource|string|null */
public static $defaultOutput = 'php://output';
protected $line = '';
+ /** @var callable|null */
protected $lineDumper;
+ /** @var resource|null */
protected $outputStream;
- protected $decimalPoint; // This is locale dependent
+ protected $decimalPoint = '.';
protected $indentPad = ' ';
protected $flags;
@@ -42,12 +45,10 @@ 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');
- $this->decimalPoint = localeconv();
- $this->decimalPoint = $this->decimalPoint['decimal_point'];
+ $this->setCharset($charset ?: \ini_get('php.output_encoding') ?: \ini_get('default_charset') ?: 'UTF-8');
$this->setOutput($output ?: static::$defaultOutput);
if (!$output && \is_string(static::$defaultOutput)) {
static::$defaultOutput = $this->outputStream;
@@ -57,9 +58,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
/**
* Sets the output destination of the dumps.
*
- * @param callable|resource|string $output A line dumper callable, an opened stream or an output path
+ * @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path
*
- * @return callable|resource|string The previous output destination
+ * @return callable|resource|string|null The previous output destination
*/
public function setOutput($output)
{
@@ -73,7 +74,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
$output = fopen($output, 'w');
}
$this->outputStream = $output;
- $this->lineDumper = [$this, 'echoLine'];
+ $this->lineDumper = $this->echoLine(...);
}
return $prev;
@@ -120,9 +121,6 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
*/
public function dump(Data $data, $output = null): ?string
{
- $this->decimalPoint = localeconv();
- $this->decimalPoint = $this->decimalPoint['decimal_point'];
-
if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(\LC_NUMERIC, 0) : null) {
setlocale(\LC_NUMERIC, 'C');
}
@@ -160,6 +158,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
*
* @param int $depth The recursive depth in the dumped structure for the line being dumped,
* or -1 to signal the end-of-dump to the line dumper callable
+ *
+ * @return void
*/
protected function dumpLine(int $depth)
{
@@ -169,6 +169,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
/**
* Generic line dumper callback.
+ *
+ * @return void
*/
protected function echoLine(string $line, int $depth, string $indentPad)
{
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php
index f6e290ca..af963707 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/CliDumper.php
@@ -22,6 +22,7 @@ use Symfony\Component\VarDumper\Cloner\Stub;
class CliDumper extends AbstractDumper
{
public static $defaultColors;
+ /** @var callable|resource|string|null */
public static $defaultOutput = 'php://stdout';
protected $colors;
@@ -51,6 +52,7 @@ class CliDumper extends AbstractDumper
"\r" => '\r',
"\033" => '\e',
];
+ protected static $unicodeCharsRx = "/[\u{00A0}\u{00AD}\u{034F}\u{061C}\u{115F}\u{1160}\u{17B4}\u{17B5}\u{180E}\u{2000}-\u{200F}\u{202F}\u{205F}\u{2060}-\u{2064}\u{206A}-\u{206F}\u{3000}\u{2800}\u{3164}\u{FEFF}\u{FFA0}\u{1D159}\u{1D173}-\u{1D17A}]/u";
protected $collapseNextHash = false;
protected $expandNextHash = false;
@@ -61,10 +63,7 @@ class CliDumper extends AbstractDumper
private bool $handlesHrefGracefully;
- /**
- * {@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);
@@ -83,11 +82,13 @@ class CliDumper extends AbstractDumper
]);
}
- $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
+ $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
}
/**
* Enables/disables colored output.
+ *
+ * @return void
*/
public function setColors(bool $colors)
{
@@ -96,6 +97,8 @@ class CliDumper extends AbstractDumper
/**
* Sets the maximum number of characters per line for dumped strings.
+ *
+ * @return void
*/
public function setMaxStringWidth(int $maxStringWidth)
{
@@ -106,6 +109,8 @@ class CliDumper extends AbstractDumper
* Configures styles.
*
* @param array $styles A map of style names to style definitions
+ *
+ * @return void
*/
public function setStyles(array $styles)
{
@@ -116,6 +121,8 @@ class CliDumper extends AbstractDumper
* Configures display options.
*
* @param array $displayOptions A map of display options to customize the behavior
+ *
+ * @return void
*/
public function setDisplayOptions(array $displayOptions)
{
@@ -123,11 +130,12 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function dumpScalar(Cursor $cursor, string $type, string|int|float|bool|null $value)
{
$this->dumpKey($cursor);
+ $this->collapseNextHash = $this->expandNextHash = false;
$style = 'const';
$attr = $cursor->attr;
@@ -137,6 +145,11 @@ class CliDumper extends AbstractDumper
$style = 'default';
break;
+ case 'label':
+ $this->styles += ['label' => $this->styles['default']];
+ $style = 'label';
+ break;
+
case 'integer':
$style = 'num';
@@ -153,17 +166,12 @@ class CliDumper extends AbstractDumper
$style = 'float';
}
- switch (true) {
- case \INF === $value: $value = 'INF'; break;
- case -\INF === $value: $value = '-INF'; break;
- case is_nan($value): $value = 'NAN'; break;
- default:
- $value = (string) $value;
- if (!str_contains($value, $this->decimalPoint)) {
- $value .= $this->decimalPoint.'0';
- }
- break;
- }
+ $value = match (true) {
+ \INF === $value => 'INF',
+ -\INF === $value => '-INF',
+ is_nan($value) => 'NAN',
+ default => !str_contains($value = (string) $value, $this->decimalPoint) ? $value .= $this->decimalPoint.'0' : $value,
+ };
break;
case 'NULL':
@@ -186,11 +194,12 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
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,13 +207,16 @@ class CliDumper extends AbstractDumper
}
if ('' === $str) {
$this->line .= '""';
+ if ($cut) {
+ $this->line .= '…'.$cut;
+ }
$this->endValue($cursor);
} else {
$attr += [
'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0,
'binary' => $bin,
];
- $str = $bin && false !== strpos($str, "\0") ? [$str] : explode("\n", $str);
+ $str = $bin && str_contains($str, "\0") ? [$str] : explode("\n", $str);
if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) {
unset($str[1]);
$str[0] .= "\n";
@@ -274,15 +286,14 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild)
{
- if (null === $this->colors) {
- $this->colors = $this->supportsColors();
- }
+ $this->colors ??= $this->supportsColors();
$this->dumpKey($cursor);
+ $this->expandNextHash = false;
$attr = $cursor->attr;
if ($this->collapseNextHash) {
@@ -315,7 +326,7 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut)
{
@@ -332,6 +343,8 @@ class CliDumper extends AbstractDumper
*
* @param bool $hasChild When the dump of the hash has child item
* @param int $cut The number of items the hash has been cut by
+ *
+ * @return void
*/
protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut)
{
@@ -348,6 +361,8 @@ class CliDumper extends AbstractDumper
/**
* Dumps a key in a hash structure.
+ *
+ * @return void
*/
protected function dumpKey(Cursor $cursor)
{
@@ -437,12 +452,11 @@ class CliDumper extends AbstractDumper
*/
protected function style(string $style, string $value, array $attr = []): string
{
- if (null === $this->colors) {
- $this->colors = $this->supportsColors();
- }
+ $this->colors ??= $this->supportsColors();
$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'])) {
$prefix = substr($value, 0, -$attr['ellipsis']);
@@ -474,7 +488,15 @@ class CliDumper extends AbstractDumper
return $s.$endCchr;
}, $value, -1, $cchrCount);
- if ($this->colors) {
+ if (!($attr['binary'] ?? false)) {
+ $value = preg_replace_callback(static::$unicodeCharsRx, function ($c) use (&$cchrCount, $startCchr, $endCchr) {
+ ++$cchrCount;
+
+ return $startCchr.'\u{'.strtoupper(dechex(mb_ord($c[0]))).'}'.$endCchr;
+ }, $value);
+ }
+
+ if ($this->colors && '' !== $value) {
if ($cchrCount && "\033" === $value[0]) {
$value = substr($value, \strlen($startCchr));
} else {
@@ -497,10 +519,15 @@ class CliDumper extends AbstractDumper
}
}
if (isset($attr['href'])) {
+ if ('label' === $style) {
+ $value .= '^';
+ }
$value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\";
}
- } elseif ($attr['if_links'] ?? false) {
- return '';
+ }
+
+ if ('label' === $style && '' !== $value) {
+ $value .= ' ';
}
return $value;
@@ -511,7 +538,7 @@ class CliDumper extends AbstractDumper
if ($this->outputStream !== static::$defaultOutput) {
return $this->hasColorSupport($this->outputStream);
}
- if (null !== static::$defaultColors) {
+ if (isset(static::$defaultColors)) {
return static::$defaultColors;
}
if (isset($_SERVER['argv'][1])) {
@@ -546,16 +573,23 @@ class CliDumper extends AbstractDumper
}
/**
- * {@inheritdoc}
+ * @return void
*/
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);
}
parent::dumpLine($depth);
}
+ /**
+ * @return void
+ */
protected function endValue(Cursor $cursor)
{
if (-1 === $cursor->hashType) {
@@ -632,7 +666,7 @@ class CliDumper extends AbstractDumper
return $result;
}
- private function getSourceLink(string $file, int $line)
+ private function getSourceLink(string $file, int $line): string|false
{
if ($fmt = $this->displayOptions['fileLinkFormat']) {
return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
index 3684a475..69dff067 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
@@ -22,8 +22,8 @@ use Symfony\Component\VarDumper\Cloner\VarCloner;
*/
final class RequestContextProvider implements ContextProviderInterface
{
- private $requestStack;
- private $cloner;
+ private RequestStack $requestStack;
+ private VarCloner $cloner;
public function __construct(RequestStack $requestStack)
{
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
index 8ef6e360..cadddfac 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
@@ -11,7 +11,8 @@
namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
-use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
+use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
+use Symfony\Component\HttpKernel\Debug\FileLinkFormatter as LegacyFileLinkFormatter;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
use Symfony\Component\VarDumper\VarDumper;
@@ -28,9 +29,9 @@ final class SourceContextProvider implements ContextProviderInterface
private int $limit;
private ?string $charset;
private ?string $projectDir;
- private $fileLinkFormatter;
+ private FileLinkFormatter|LegacyFileLinkFormatter|null $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|LegacyFileLinkFormatter|null $fileLinkFormatter = null, int $limit = 9)
{
$this->charset = $charset;
$this->projectDir = $projectDir;
@@ -44,7 +45,7 @@ final class SourceContextProvider implements ContextProviderInterface
$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/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
index 18ab56eb..84cfb425 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ContextualizedDumper.php
@@ -19,7 +19,7 @@ use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
*/
class ContextualizedDumper implements DataDumperInterface
{
- private $wrappedDumper;
+ private DataDumperInterface $wrappedDumper;
private array $contextProviders;
/**
@@ -31,13 +31,16 @@ class ContextualizedDumper implements DataDumperInterface
$this->contextProviders = $contextProviders;
}
+ /**
+ * @return string|null
+ */
public function dump(Data $data)
{
- $context = [];
+ $context = $data->getContext();
foreach ($this->contextProviders as $contextProvider) {
- $context[\get_class($contextProvider)] = $contextProvider->getContext();
+ $context[$contextProvider::class] = $contextProvider->getContext();
}
- $this->wrappedDumper->dump($data->withContext($context));
+ return $this->wrappedDumper->dump($data->withContext($context));
}
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
index b173bccf..df05b6af 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
@@ -20,5 +20,8 @@ use Symfony\Component\VarDumper\Cloner\Data;
*/
interface DataDumperInterface
{
+ /**
+ * @return string|null
+ */
public function dump(Data $data);
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
index 40e97a53..ea09e681 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
@@ -21,6 +21,7 @@ use Symfony\Component\VarDumper\Cloner\Data;
*/
class HtmlDumper extends CliDumper
{
+ /** @var callable|resource|string|null */
public static $defaultOutput = 'php://output';
protected static $themes = [
@@ -74,19 +75,16 @@ class HtmlDumper extends CliDumper
];
private array $extraDisplayOptions = [];
- /**
- * {@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();
- $this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
+ $this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
$this->styles = static::$themes['dark'] ?? self::$themes['dark'];
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function setStyles(array $styles)
{
@@ -94,6 +92,9 @@ class HtmlDumper extends CliDumper
$this->styles = $styles + $this->styles;
}
+ /**
+ * @return void
+ */
public function setTheme(string $themeName)
{
if (!isset(static::$themes[$themeName])) {
@@ -107,6 +108,8 @@ class HtmlDumper extends CliDumper
* Configures display options.
*
* @param array $displayOptions A map of display options to customize the behavior
+ *
+ * @return void
*/
public function setDisplayOptions(array $displayOptions)
{
@@ -116,6 +119,8 @@ class HtmlDumper extends CliDumper
/**
* Sets an HTML header that will be dumped once in the output stream.
+ *
+ * @return void
*/
public function setDumpHeader(?string $header)
{
@@ -124,6 +129,8 @@ class HtmlDumper extends CliDumper
/**
* Sets an HTML prefix and suffix that will encapse every single dump.
+ *
+ * @return void
*/
public function setDumpBoundaries(string $prefix, string $suffix)
{
@@ -131,9 +138,6 @@ class HtmlDumper extends CliDumper
$this->dumpSuffix = $suffix;
}
- /**
- * {@inheritdoc}
- */
public function dump(Data $data, $output = null, array $extraDisplayOptions = []): ?string
{
$this->extraDisplayOptions = $extraDisplayOptions;
@@ -145,6 +149,8 @@ class HtmlDumper extends CliDumper
/**
* Dumps the HTML header.
+ *
+ * @return string
*/
protected function getDumpHeader()
{
@@ -158,19 +164,15 @@ class HtmlDumper extends CliDumper
<script>
Sfdump = window.Sfdump || (function (doc) {
-var refStyle = doc.createElement('style'),
- rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
+doc.documentElement.classList.add('sf-js-enabled');
+
+var rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
idRx = /\bsf-dump-\d+-ref[012]\w+\b/,
keyHint = 0 <= navigator.platform.toUpperCase().indexOf('MAC') ? 'Cmd' : 'Ctrl',
addEventListener = function (e, n, cb) {
e.addEventListener(n, cb, false);
};
-refStyle.innerHTML = 'pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }';
-(doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle);
-refStyle = doc.createElement('style');
-(doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle);
-
if (!doc.addEventListener) {
addEventListener = function (element, eventName, callback) {
element.attachEvent('on' + eventName, function (e) {
@@ -350,26 +352,16 @@ return function (root, x) {
function xpathHasClass(className) {
return "contains(concat(' ', normalize-space(@class), ' '), ' " + className +" ')";
}
- addEventListener(root, 'mouseover', function (e) {
- if ('' != refStyle.innerHTML) {
- refStyle.innerHTML = '';
- }
- });
a('mouseover', function (a, e, c) {
if (c) {
e.target.style.cursor = "pointer";
- } else if (a = idRx.exec(a.className)) {
- try {
- refStyle.innerHTML = 'pre.sf-dump .'+a[0]+'{background-color: #B729D9; color: #FFF !important; border-radius: 2px}';
- } catch (e) {
- }
}
});
a('click', function (a, e, c) {
if (/\bsf-dump-toggle\b/.test(a.className)) {
e.preventDefault();
if (!toggle(a, isCtrlKey(e))) {
- var r = doc.getElementById(a.getAttribute('href').substr(1)),
+ var r = doc.getElementById(a.getAttribute('href').slice(1)),
s = r.previousSibling,
f = r.parentNode,
t = a.parentNode;
@@ -430,7 +422,8 @@ return function (root, x) {
x += elt.parentNode.getAttribute('data-depth')/1;
}
} else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
- a = a.substr(1);
+ a = a.slice(1);
+ elt.className += ' sf-dump-hover';
elt.className += ' '+a;
if (/[\[{]$/.test(elt.previousSibling.nodeValue)) {
@@ -647,6 +640,16 @@ return function (root, x) {
})(document);
</script><style>
+.sf-js-enabled pre.sf-dump .sf-dump-compact,
+.sf-js-enabled .sf-dump-str-collapse .sf-dump-str-collapse,
+.sf-js-enabled .sf-dump-str-expand .sf-dump-str-expand {
+ display: none;
+}
+.sf-dump-hover:hover {
+ background-color: #B729D9;
+ color: #FFF !important;
+ border-radius: 2px;
+}
pre.sf-dump {
display: block;
white-space: pre;
@@ -661,7 +664,7 @@ pre.sf-dump:after {
clear: both;
}
pre.sf-dump span {
- display: inline;
+ display: inline-flex;
}
pre.sf-dump a {
text-decoration: none;
@@ -783,7 +786,7 @@ EOHTML
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
{
@@ -801,7 +804,7 @@ EOHTML
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function enterHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild)
{
@@ -832,7 +835,7 @@ EOHTML
}
/**
- * {@inheritdoc}
+ * @return void
*/
public function leaveHash(Cursor $cursor, int $type, string|int|null $class, bool $hasChild, int $cut)
{
@@ -843,12 +846,9 @@ EOHTML
parent::leaveHash($cursor, $type, $class, $hasChild, 0);
}
- /**
- * {@inheritdoc}
- */
protected function style(string $style, string $value, array $attr = []): string
{
- if ('' === $value) {
+ if ('' === $value && ('label' !== $style || !isset($attr['file']) && !isset($attr['href']))) {
return '';
}
@@ -864,7 +864,7 @@ EOHTML
}
if ('const' === $style && isset($attr['value'])) {
- $style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
+ $style .= sprintf(' title="%s"', esc(\is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));
} elseif ('public' === $style) {
$style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');
} elseif ('str' === $style && 1 < $attr['length']) {
@@ -883,7 +883,6 @@ EOHTML
} elseif ('private' === $style) {
$style .= sprintf(' title="Private property defined in class: `%s`"', esc($this->utf8Encode($attr['class'])));
}
- $map = static::$controlCharsMap;
if (isset($attr['ellipsis'])) {
$class = 'sf-dump-ellipsis';
@@ -902,6 +901,7 @@ EOHTML
}
}
+ $map = static::$controlCharsMap;
$v = "<span class=sf-dump-{$style}>".preg_replace_callback(static::$controlCharsRx, function ($c) use ($map) {
$s = $b = '<span class="sf-dump-default';
$c = $c[$i = 0];
@@ -924,22 +924,34 @@ EOHTML
return $s.'</span>';
}, $v).'</span>';
+ if (!($attr['binary'] ?? false)) {
+ $v = preg_replace_callback(static::$unicodeCharsRx, function ($c) {
+ return '<span class=sf-dump-default>\u{'.strtoupper(dechex(mb_ord($c[0]))).'}</span>';
+ }, $v);
+ }
+
if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], $attr['line'] ?? 0)) {
$attr['href'] = $href;
}
if (isset($attr['href'])) {
+ if ('label' === $style) {
+ $v .= '^';
+ }
$target = isset($attr['file']) ? '' : ' target="_blank"';
$v = sprintf('<a href="%s"%s rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $target, $v);
}
if (isset($attr['lang'])) {
$v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v);
}
+ if ('label' === $style) {
+ $v .= ' ';
+ }
return $v;
}
/**
- * {@inheritdoc}
+ * @return void
*/
protected function dumpLine(int $depth, bool $endOfValue = false)
{
@@ -960,7 +972,7 @@ EOHTML
}
$this->lastDepth = $depth;
- $this->line = mb_convert_encoding($this->line, 'HTML-ENTITIES', 'UTF-8');
+ $this->line = mb_encode_numericentity($this->line, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8');
if (-1 === $depth) {
AbstractDumper::dumpLine(0);
@@ -968,7 +980,7 @@ EOHTML
AbstractDumper::dumpLine($depth);
}
- private function getSourceLink(string $file, int $line)
+ private function getSourceLink(string $file, int $line): string|false
{
$options = $this->extraDisplayOptions + $this->displayOptions;
@@ -980,7 +992,7 @@ EOHTML
}
}
-function esc(string $str)
+function esc(string $str): string
{
return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8');
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ServerDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ServerDumper.php
index 94795bf6..60fdd7ac 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ServerDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Dumper/ServerDumper.php
@@ -22,15 +22,15 @@ use Symfony\Component\VarDumper\Server\Connection;
*/
class ServerDumper implements DataDumperInterface
{
- private $connection;
- private $wrappedDumper;
+ private Connection $connection;
+ private ?DataDumperInterface $wrappedDumper;
/**
* @param string $host The server host
* @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;
@@ -42,12 +42,14 @@ class ServerDumper implements DataDumperInterface
}
/**
- * {@inheritdoc}
+ * @return string|null
*/
public function dump(Data $data)
{
if (!$this->connection->write($data) && $this->wrappedDumper) {
- $this->wrappedDumper->dump($data);
+ return $this->wrappedDumper->dump($data);
}
+
+ return null;
}
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php b/data/web/inc/lib/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
index 122f0d35..fd8eca9f 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
@@ -21,6 +21,6 @@ class ThrowingCasterException extends \Exception
*/
public function __construct(\Throwable $prev)
{
- parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev);
+ parent::__construct('Unexpected '.$prev::class.' thrown from a caster: '.$prev->getMessage(), 0, $prev);
}
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE b/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE
index a843ec12..29f72d5e 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2022 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/data/web/inc/lib/vendor/symfony/var-dumper/Resources/bin/var-dump-server b/data/web/inc/lib/vendor/symfony/var-dumper/Resources/bin/var-dump-server
index 98c813a0..f398fcef 100755
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Resources/bin/var-dump-server
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Resources/bin/var-dump-server
@@ -10,6 +10,10 @@
* file that was distributed with this source code.
*/
+if ('cli' !== PHP_SAPI) {
+ throw new Exception('This script must be run from the command line.');
+}
+
/**
* Starts a dump server to collect and output dumps on a single place with multiple formats support.
*
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php b/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php
index 6221a4d1..f2ff74c0 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Resources/functions/dump.php
@@ -9,40 +9,52 @@
* file that was distributed with this source code.
*/
+use Symfony\Component\VarDumper\Caster\ScalarStub;
use Symfony\Component\VarDumper\VarDumper;
if (!function_exists('dump')) {
/**
* @author Nicolas Grekas <[email protected]>
+ * @author Alexandre Daubois <[email protected]>
*/
- function dump(mixed $var, mixed ...$moreVars): mixed
+ function dump(mixed ...$vars): mixed
{
- VarDumper::dump($var);
+ if (!$vars) {
+ VarDumper::dump(new ScalarStub('🐛'));
- foreach ($moreVars as $v) {
- VarDumper::dump($v);
+ return null;
}
- if (1 < func_num_args()) {
- return func_get_args();
+ if (array_key_exists(0, $vars) && 1 === count($vars)) {
+ VarDumper::dump($vars[0]);
+ $k = 0;
+ } else {
+ foreach ($vars as $k => $v) {
+ VarDumper::dump($v, is_int($k) ? 1 + $k : $k);
+ }
}
- return $var;
+ if (1 < count($vars)) {
+ return $vars;
+ }
+
+ return $vars[$k];
}
}
if (!function_exists('dd')) {
- /**
- * @return never
- */
- function dd(...$vars): void
+ function dd(mixed ...$vars): never
{
- if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) {
+ if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) && !headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
- foreach ($vars as $v) {
- VarDumper::dump($v);
+ if (array_key_exists(0, $vars) && 1 === count($vars)) {
+ VarDumper::dump($vars[0]);
+ } else {
+ foreach ($vars as $k => $v) {
+ VarDumper::dump($v, is_int($k) ? 1 + $k : $k);
+ }
}
exit(1);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php b/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php
index 97b5b94f..4383278c 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Server/Connection.php
@@ -62,7 +62,7 @@ class Connection
$context = array_filter($context);
$encodedPayload = base64_encode(serialize([$data, $context]))."\n";
- set_error_handler([self::class, 'nullErrorHandler']);
+ set_error_handler(static fn () => null);
try {
if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
return true;
@@ -82,16 +82,14 @@ class Connection
return false;
}
- private static function nullErrorHandler(int $t, string $m)
- {
- // no-op
- }
-
+ /**
+ * @return resource|null
+ */
private function createSocket()
{
- set_error_handler([self::class, 'nullErrorHandler']);
+ set_error_handler(static fn () => null);
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) ?: null;
} finally {
restore_error_handler();
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php b/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php
index 6a43c120..a9228a2e 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/Server/DumpServer.php
@@ -25,14 +25,14 @@ use Symfony\Component\VarDumper\Cloner\Stub;
class DumpServer
{
private string $host;
- private $logger;
+ private ?LoggerInterface $logger;
/**
* @var resource|null
*/
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;
@@ -56,25 +56,19 @@ class DumpServer
}
foreach ($this->getMessages() as $clientId => $message) {
- if ($this->logger) {
- $this->logger->info('Received a payload from client {clientId}', ['clientId' => $clientId]);
- }
+ $this->logger?->info('Received a payload from client {clientId}', ['clientId' => $clientId]);
$payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]);
// Impossible to decode the message, give up.
if (false === $payload) {
- if ($this->logger) {
- $this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
- }
+ $this->logger?->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
continue;
}
if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) {
- if ($this->logger) {
- $this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
- }
+ $this->logger?->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
continue;
}
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php b/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
index a202185e..4475efd1 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
+++ b/data/web/inc/lib/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;
@@ -52,7 +52,7 @@ trait VarDumperTestTrait
$this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
}
- protected function getDump(mixed $data, string|int $key = null, int $filter = 0): ?string
+ protected function getDump(mixed $data, string|int|null $key = null, int $filter = 0): ?string
{
if (null === $flags = $this->varDumperConfig['flags']) {
$flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php b/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php
index dfef9f41..e1400f15 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/VarDumper.php
@@ -11,9 +11,9 @@
namespace Symfony\Component\VarDumper;
+use Symfony\Component\ErrorHandler\ErrorRenderer\FileLinkFormatter;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
-use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
use Symfony\Component\VarDumper\Caster\ReflectionCaster;
use Symfony\Component\VarDumper\Cloner\VarCloner;
use Symfony\Component\VarDumper\Dumper\CliDumper;
@@ -37,17 +37,26 @@ class VarDumper
*/
private static $handler;
- public static function dump(mixed $var)
+ /**
+ * @param string|null $label
+ *
+ * @return mixed
+ */
+ public static function dump(mixed $var/* , string $label = null */)
{
+ $label = 2 <= \func_num_args() ? func_get_arg(1) : null;
if (null === self::$handler) {
self::register();
}
- return (self::$handler)($var);
+ return (self::$handler)($var, $label);
}
- public static function setHandler(callable $callable = null): ?callable
+ public static function setHandler(?callable $callable = null): ?callable
{
+ if (1 > \func_num_args()) {
+ trigger_deprecation('symfony/var-dumper', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);
+ }
$prevHandler = self::$handler;
// Prevent replacing the handler with expected format as soon as the env var was set:
@@ -76,19 +85,25 @@ class VarDumper
case 'server' === $format:
case $format && 'tcp' === parse_url($format, \PHP_URL_SCHEME):
$host = 'server' === $format ? $_SERVER['VAR_DUMPER_SERVER'] ?? '127.0.0.1:9912' : $format;
- $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper();
+ $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) ? new CliDumper() : new HtmlDumper();
$dumper = new ServerDumper($host, $dumper, self::getDefaultContextProviders());
break;
default:
- $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper();
+ $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) ? new CliDumper() : new HtmlDumper();
}
if (!$dumper instanceof ServerDumper) {
$dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]);
}
- self::$handler = function ($var) use ($cloner, $dumper) {
- $dumper->dump($cloner->cloneVar($var));
+ self::$handler = function ($var, ?string $label = null) use ($cloner, $dumper) {
+ $var = $cloner->cloneVar($var);
+
+ if (null !== $label) {
+ $var = $var->withContext(['label' => $label]);
+ }
+
+ $dumper->dump($var);
};
}
@@ -96,7 +111,7 @@ class VarDumper
{
$contextProviders = [];
- if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && (class_exists(Request::class))) {
+ if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) && class_exists(Request::class)) {
$requestStack = new RequestStack();
$requestStack->push(Request::createFromGlobals());
$contextProviders['request'] = new RequestContextProvider($requestStack);
diff --git a/data/web/inc/lib/vendor/symfony/var-dumper/composer.json b/data/web/inc/lib/vendor/symfony/var-dumper/composer.json
index db04f588..e6166f86 100644
--- a/data/web/inc/lib/vendor/symfony/var-dumper/composer.json
+++ b/data/web/inc/lib/vendor/symfony/var-dumper/composer.json
@@ -16,25 +16,22 @@
}
],
"require": {
- "php": ">=8.0.2",
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"ext-iconv": "*",
- "symfony/console": "^5.4|^6.0",
- "symfony/process": "^5.4|^6.0",
- "symfony/uid": "^5.4|^6.0",
+ "symfony/console": "^5.4|^6.0|^7.0",
+ "symfony/error-handler": "^6.3|^7.0",
+ "symfony/http-kernel": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/uid": "^5.4|^6.0|^7.0",
"twig/twig": "^2.13|^3.0.4"
},
"conflict": {
- "phpunit/phpunit": "<5.4.3",
"symfony/console": "<5.4"
},
- "suggest": {
- "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
- "ext-intl": "To show region name in time zone dump",
- "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
- },
"autoload": {
"files": [ "Resources/functions/dump.php" ],
"psr-4": { "Symfony\\Component\\VarDumper\\": "" },
diff --git a/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml b/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml
index c9325213..406c4004 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml
+++ b/data/web/inc/lib/vendor/tightenco/collect/.github/workflows/run-tests.yml
@@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, macOS]
- php: [7.3, 7.4, 8.0, 8.1]
+ php: [8.0, 8.1, 8.2]
include:
- os: Ubuntu
@@ -25,7 +25,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@v4
+ uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
diff --git a/data/web/inc/lib/vendor/tightenco/collect/composer.json b/data/web/inc/lib/vendor/tightenco/collect/composer.json
index 88ebb77a..949635dc 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/composer.json
+++ b/data/web/inc/lib/vendor/tightenco/collect/composer.json
@@ -10,7 +10,7 @@
}
],
"require": {
- "php": "^7.3|^8.0",
+ "php": "^8.0",
"symfony/var-dumper": "^3.4 || ^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
@@ -33,7 +33,6 @@
"tests/files/Support/HtmlString.php",
"tests/files/Support/HigherOrderTapProxy.php",
"tests/files/Support/Str.php",
- "tests/files/Support/Traits/Conditionable.php",
"tests/files/Support/Stringable.php",
"tests/files/Support/ItemNotFoundException.php",
"tests/files/Support/MultipleItemsFoundException.php",
diff --git a/data/web/inc/lib/vendor/tightenco/collect/framework-.zip b/data/web/inc/lib/vendor/tightenco/collect/framework-.zip
new file mode 100644
index 00000000..e69de29b
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Conditionable/HigherOrderWhenProxy.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Conditionable/HigherOrderWhenProxy.php
new file mode 100644
index 00000000..eaf24812
--- /dev/null
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Conditionable/HigherOrderWhenProxy.php
@@ -0,0 +1,109 @@
+<?php
+
+namespace Tightenco\Collect\Conditionable;
+
+class HigherOrderWhenProxy
+{
+ /**
+ * The target being conditionally operated on.
+ *
+ * @var mixed
+ */
+ protected $target;
+
+ /**
+ * The condition for proxying.
+ *
+ * @var bool
+ */
+ protected $condition;
+
+ /**
+ * Indicates whether the proxy has a condition.
+ *
+ * @var bool
+ */
+ protected $hasCondition = false;
+
+ /**
+ * Determine whether the condition should be negated.
+ *
+ * @var bool
+ */
+ protected $negateConditionOnCapture;
+
+ /**
+ * Create a new proxy instance.
+ *
+ * @param mixed $target
+ * @return void
+ */
+ public function __construct($target)
+ {
+ $this->target = $target;
+ }
+
+ /**
+ * Set the condition on the proxy.
+ *
+ * @param bool $condition
+ * @return $this
+ */
+ public function condition($condition)
+ {
+ [$this->condition, $this->hasCondition] = [$condition, true];
+
+ return $this;
+ }
+
+ /**
+ * Indicate that the condition should be negated.
+ *
+ * @return $this
+ */
+ public function negateConditionOnCapture()
+ {
+ $this->negateConditionOnCapture = true;
+
+ return $this;
+ }
+
+ /**
+ * Proxy accessing an attribute onto the target.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ if (! $this->hasCondition) {
+ $condition = $this->target->{$key};
+
+ return $this->condition($this->negateConditionOnCapture ? ! $condition : $condition);
+ }
+
+ return $this->condition
+ ? $this->target->{$key}
+ : $this->target;
+ }
+
+ /**
+ * Proxy a method call on the target.
+ *
+ * @param string $method
+ * @param array $parameters
+ * @return mixed
+ */
+ public function __call($method, $parameters)
+ {
+ if (! $this->hasCondition) {
+ $condition = $this->target->{$method}(...$parameters);
+
+ return $this->condition($this->negateConditionOnCapture ? ! $condition : $condition);
+ }
+
+ return $this->condition
+ ? $this->target->{$method}(...$parameters)
+ : $this->target;
+ }
+}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php
index a2058040..190bb9bc 100755
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php
@@ -2,12 +2,16 @@
namespace Tightenco\Collect\Contracts\Support;
+/**
+ * @template TKey of array-key
+ * @template TValue
+ */
interface Arrayable
{
/**
* Get the instance as an array.
*
- * @return array
+ * @return array<TKey, TValue>
*/
public function toArray();
}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php
index 57350cca..f3a4b042 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Arr.php
@@ -2,6 +2,7 @@
namespace Tightenco\Collect\Support;
+use ArgumentCountError;
use ArrayAccess;
use Tightenco\Collect\Support\Traits\Macroable;
use InvalidArgumentException;
@@ -25,7 +26,7 @@ class Arr
* Add an element to an array using "dot" notation if it doesn't exist.
*
* @param array $array
- * @param string $key
+ * @param string|int|float $key
* @param mixed $value
* @return array
*/
@@ -142,7 +143,7 @@ class Arr
* Get all of the given array except for a specified array of keys.
*
* @param array $array
- * @param array|string $keys
+ * @param array|string|int|float $keys
* @return array
*/
public static function except($array, $keys)
@@ -169,6 +170,10 @@ class Arr
return $array->offsetExists($key);
}
+ if (is_float($key)) {
+ $key = (string) $key;
+ }
+
return array_key_exists($key, $array);
}
@@ -252,7 +257,7 @@ class Arr
* Remove one or many array items from a given array using "dot" notation.
*
* @param array $array
- * @param array|string $keys
+ * @param array|string|int|float $keys
* @return void
*/
public static function forget(&$array, $keys)
@@ -281,7 +286,7 @@ class Arr
while (count($parts) > 1) {
$part = array_shift($parts);
- if (isset($array[$part]) && is_array($array[$part])) {
+ if (isset($array[$part]) && static::accessible($array[$part])) {
$array = &$array[$part];
} else {
continue 2;
@@ -314,7 +319,7 @@ class Arr
return $array[$key];
}
- if (strpos($key, '.') === false) {
+ if (! str_contains($key, '.')) {
return $array[$key] ?? value($default);
}
@@ -423,6 +428,59 @@ class Arr
return ! self::isAssoc($array);
}
+ /**
+ * Join all items using a string. The final items can use a separate glue string.
+ *
+ * @param array $array
+ * @param string $glue
+ * @param string $finalGlue
+ * @return string
+ */
+ public static function join($array, $glue, $finalGlue = '')
+ {
+ if ($finalGlue === '') {
+ return implode($glue, $array);
+ }
+
+ if (count($array) === 0) {
+ return '';
+ }
+
+ if (count($array) === 1) {
+ return end($array);
+ }
+
+ $finalItem = array_pop($array);
+
+ return implode($glue, $array).$finalGlue.$finalItem;
+ }
+
+ /**
+ * Key an associative array by a field or using a callback.
+ *
+ * @param array $array
+ * @param callable|array|string $keyBy
+ * @return array
+ */
+ public static function keyBy($array, $keyBy)
+ {
+ return Collection::make($array)->keyBy($keyBy)->all();
+ }
+
+ /**
+ * Prepend the key names of an associative array.
+ *
+ * @param array $array
+ * @param string $prependWith
+ * @return array
+ */
+ public static function prependKeysWith($array, $prependWith)
+ {
+ return Collection::make($array)->mapWithKeys(function ($item, $key) use ($prependWith) {
+ return [$prependWith.$key => $item];
+ })->all();
+ }
+
/**
* Get a subset of the items from the given array.
*
@@ -487,6 +545,26 @@ class Arr
return [$value, $key];
}
+ /**
+ * Run a map over each of the items in the array.
+ *
+ * @param array $array
+ * @param callable $callback
+ * @return array
+ */
+ public static function map(array $array, callable $callback)
+ {
+ $keys = array_keys($array);
+
+ try {
+ $items = array_map($callback, $array, $keys);
+ } catch (ArgumentCountError) {
+ $items = array_map($callback, $array);
+ }
+
+ return array_combine($keys, $items);
+ }
+
/**
* Push an item onto the beginning of an array.
*
@@ -510,7 +588,7 @@ class Arr
* Get a value from the array, and remove it.
*
* @param array $array
- * @param string $key
+ * @param string|int $key
* @param mixed $default
* @return mixed
*/
@@ -539,7 +617,7 @@ class Arr
*
* @param array $array
* @param int|null $number
- * @param bool|false $preserveKeys
+ * @param bool $preserveKeys
* @return mixed
*
* @throws \InvalidArgumentException
@@ -587,7 +665,7 @@ class Arr
* If no key is given to the method, the entire array will be replaced.
*
* @param array $array
- * @param string|null $key
+ * @param string|int|null $key
* @param mixed $value
* @return array
*/
@@ -653,6 +731,18 @@ class Arr
return Collection::make($array)->sortBy($callback)->all();
}
+ /**
+ * Sort the array in descending order using the given callback or "dot" notation.
+ *
+ * @param array $array
+ * @param callable|array|string|null $callback
+ * @return array
+ */
+ public static function sortDesc($array, $callback = null)
+ {
+ return Collection::make($array)->sortByDesc($callback)->all();
+ }
+
/**
* Recursively sort an array by keys and values.
*
@@ -705,6 +795,29 @@ class Arr
return implode(' ', $classes);
}
+ /**
+ * Conditionally compile styles from an array into a style list.
+ *
+ * @param array $array
+ * @return string
+ */
+ public static function toCssStyles($array)
+ {
+ $styleList = static::wrap($array);
+
+ $styles = [];
+
+ foreach ($styleList as $class => $constraint) {
+ if (is_numeric($class)) {
+ $styles[] = Str::finish($constraint, ';');
+ } elseif ($constraint) {
+ $styles[] = Str::finish($class, ';');
+ }
+ }
+
+ return implode(' ', $styles);
+ }
+
/**
* Filter the array using the given callback.
*
@@ -725,9 +838,7 @@ class Arr
*/
public static function whereNotNull($array)
{
- return static::where($array, function ($value) {
- return ! is_null($value);
- });
+ return static::where($array, fn ($value) => ! is_null($value));
}
/**
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php
index 577e3515..e705ee0d 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Collection.php
@@ -8,22 +8,33 @@ use Tightenco\Collect\Contracts\Support\CanBeEscapedWhenCastToString;
use Tightenco\Collect\Support\Traits\EnumeratesValues;
use Tightenco\Collect\Support\Traits\Macroable;
use stdClass;
-
+use Traversable;
+
+/**
+ * @template TKey of array-key
+ * @template TValue
+ *
+ * @implements \ArrayAccess<TKey, TValue>
+ * @implements \Tightenco\Collect\Support\Enumerable<TKey, TValue>
+ */
class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable
{
+ /**
+ * @use \Tightenco\Collect\Support\Traits\EnumeratesValues<TKey, TValue>
+ */
use EnumeratesValues, Macroable;
/**
* The items contained in the collection.
*
- * @var array
+ * @var array<TKey, TValue>
*/
protected $items = [];
/**
* Create a new collection.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|null $items
* @return void
*/
public function __construct($items = [])
@@ -36,7 +47,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* @param int $from
* @param int $to
- * @return static
+ * @return static<int, int>
*/
public static function range($from, $to)
{
@@ -46,7 +57,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get all of the items in the collection.
*
- * @return array
+ * @return array<TKey, TValue>
*/
public function all()
{
@@ -56,7 +67,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get a lazy collection for the items in this collection.
*
- * @return \Tightenco\Collect\Support\LazyCollection
+ * @return \Tightenco\Collect\Support\LazyCollection<TKey, TValue>
*/
public function lazy()
{
@@ -66,18 +77,16 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the average value of a given key.
*
- * @param callable|string|null $callback
- * @return mixed
+ * @param (callable(TValue): float|int)|string|null $callback
+ * @return float|int|null
*/
public function avg($callback = null)
{
$callback = $this->valueRetriever($callback);
- $items = $this->map(function ($value) use ($callback) {
- return $callback($value);
- })->filter(function ($value) {
- return ! is_null($value);
- });
+ $items = $this
+ ->map(fn ($value) => $callback($value))
+ ->filter(fn ($value) => ! is_null($value));
if ($count = $items->count()) {
return $items->sum() / $count;
@@ -87,15 +96,14 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the median of a given key.
*
- * @param string|array|null $key
- * @return mixed
+ * @param string|array<array-key, string>|null $key
+ * @return float|int|null
*/
public function median($key = null)
{
$values = (isset($key) ? $this->pluck($key) : $this)
- ->filter(function ($item) {
- return ! is_null($item);
- })->sort()->values();
+ ->filter(fn ($item) => ! is_null($item))
+ ->sort()->values();
$count = $values->count();
@@ -117,8 +125,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the mode of a given key.
*
- * @param string|array|null $key
- * @return array|null
+ * @param string|array<array-key, string>|null $key
+ * @return array<int, float|int>|null
*/
public function mode($key = null)
{
@@ -130,23 +138,20 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
$counts = new static;
- $collection->each(function ($value) use ($counts) {
- $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1;
- });
+ $collection->each(fn ($value) => $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1);
$sorted = $counts->sort();
$highestValue = $sorted->last();
- return $sorted->filter(function ($value) use ($highestValue) {
- return $value == $highestValue;
- })->sort()->keys()->all();
+ return $sorted->filter(fn ($value) => $value == $highestValue)
+ ->sort()->keys()->all();
}
/**
* Collapse the collection of items into a single array.
*
- * @return static
+ * @return static<int, mixed>
*/
public function collapse()
{
@@ -156,7 +161,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Determine if an item exists in the collection.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
@@ -176,6 +181,26 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
return $this->contains($this->operatorForWhere(...func_get_args()));
}
+ /**
+ * Determine if an item exists, using strict comparison.
+ *
+ * @param (callable(TValue): bool)|TValue|array-key $key
+ * @param TValue|null $value
+ * @return bool
+ */
+ public function containsStrict($key, $value = null)
+ {
+ if (func_num_args() === 2) {
+ return $this->contains(fn ($item) => data_get($item, $key) === $value);
+ }
+
+ if ($this->useAsCallable($key)) {
+ return ! is_null($this->first($key));
+ }
+
+ return in_array($key, $this->items, true);
+ }
+
/**
* Determine if an item is not contained in the collection.
*
@@ -192,8 +217,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Cross join with the given lists, returning all possible permutations.
*
- * @param mixed ...$lists
- * @return static
+ * @template TCrossJoinKey
+ * @template TCrossJoinValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TCrossJoinKey, TCrossJoinValue>|iterable<TCrossJoinKey, TCrossJoinValue> ...$lists
+ * @return static<int, array<int, TValue|TCrossJoinValue>>
*/
public function crossJoin(...$lists)
{
@@ -205,7 +233,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items in the collection that are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
* @return static
*/
public function diff($items)
@@ -216,8 +244,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items in the collection that are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
* @return static
*/
public function diffUsing($items, callable $callback)
@@ -228,7 +256,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items in the collection whose keys and values are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function diffAssoc($items)
@@ -239,8 +267,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items in the collection whose keys and values are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function diffAssocUsing($items, callable $callback)
@@ -251,7 +279,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items in the collection whose keys are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function diffKeys($items)
@@ -262,8 +290,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items in the collection whose keys are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function diffKeysUsing($items, callable $callback)
@@ -274,7 +302,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Retrieve duplicate items from the collection.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): bool)|string|null $callback
* @param bool $strict
* @return static
*/
@@ -302,7 +330,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Retrieve duplicate items from the collection using strict comparison.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): bool)|string|null $callback
* @return static
*/
public function duplicatesStrict($callback = null)
@@ -314,25 +342,21 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Get the comparison function to detect duplicates.
*
* @param bool $strict
- * @return \Closure
+ * @return callable(TValue, TValue): bool
*/
protected function duplicateComparator($strict)
{
if ($strict) {
- return function ($a, $b) {
- return $a === $b;
- };
+ return fn ($a, $b) => $a === $b;
}
- return function ($a, $b) {
- return $a == $b;
- };
+ return fn ($a, $b) => $a == $b;
}
/**
* Get all items except for those with the specified keys.
*
- * @param \Tightenco\Collect\Support\Collection|mixed $keys
+ * @param \Tightenco\Collect\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys
* @return static
*/
public function except($keys)
@@ -349,7 +373,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Run a filter over each of the items.
*
- * @param callable|null $callback
+ * @param (callable(TValue, TKey): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null)
@@ -364,9 +388,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the first item from the collection passing the given truth test.
*
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
+ * @template TFirstDefault
+ *
+ * @param (callable(TValue, TKey): bool)|null $callback
+ * @param TFirstDefault|(\Closure(): TFirstDefault) $default
+ * @return TValue|TFirstDefault
*/
public function first(callable $callback = null, $default = null)
{
@@ -377,7 +403,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Get a flattened array of the items in the collection.
*
* @param int $depth
- * @return static
+ * @return static<int, mixed>
*/
public function flatten($depth = INF)
{
@@ -387,7 +413,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Flip the items in the collection.
*
- * @return static
+ * @return static<TValue, TKey>
*/
public function flip()
{
@@ -397,7 +423,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Remove an item from the collection by key.
*
- * @param string|int|array $keys
+ * @param TKey|array<array-key, TKey> $keys
* @return $this
*/
public function forget($keys)
@@ -412,9 +438,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get an item from the collection by key.
*
- * @param mixed $key
- * @param mixed $default
- * @return mixed
+ * @template TGetDefault
+ *
+ * @param TKey $key
+ * @param TGetDefault|(\Closure(): TGetDefault) $default
+ * @return TValue|TGetDefault
*/
public function get($key, $default = null)
{
@@ -446,9 +474,9 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Group an associative array by a field or using a callback.
*
- * @param array|callable|string $groupBy
+ * @param (callable(TValue, TKey): array-key)|array|string $groupBy
* @param bool $preserveKeys
- * @return static
+ * @return static<array-key, static<array-key, TValue>>
*/
public function groupBy($groupBy, $preserveKeys = false)
{
@@ -470,7 +498,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
}
foreach ($groupKeys as $groupKey) {
- $groupKey = is_bool($groupKey) ? (int) $groupKey : $groupKey;
+ $groupKey = match (true) {
+ is_bool($groupKey) => (int) $groupKey,
+ $groupKey instanceof \Stringable => (string) $groupKey,
+ default => $groupKey,
+ };
if (! array_key_exists($groupKey, $results)) {
$results[$groupKey] = new static;
@@ -492,8 +524,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Key an associative array by a field or using a callback.
*
- * @param callable|string $keyBy
- * @return static
+ * @param (callable(TValue, TKey): array-key)|array|string $keyBy
+ * @return static<array-key, TValue>
*/
public function keyBy($keyBy)
{
@@ -517,7 +549,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Determine if an item exists in the collection by key.
*
- * @param mixed $key
+ * @param TKey|array<array-key, TKey> $key
* @return bool
*/
public function has($key)
@@ -559,12 +591,16 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Concatenate values of a given key as a string.
*
- * @param string $value
+ * @param callable|string $value
* @param string|null $glue
* @return string
*/
public function implode($value, $glue = null)
{
+ if ($this->useAsCallable($value)) {
+ return implode($glue ?? '', $this->map($value)->all());
+ }
+
$first = $this->first();
if (is_array($first) || (is_object($first) && ! $first instanceof \Illuminate\Support\Stringable)) {
@@ -577,7 +613,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Intersect the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function intersect($items)
@@ -585,10 +621,45 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
return new static(array_intersect($this->items, $this->getArrayableItems($items)));
}
+ /**
+ * Intersect the collection with the given items, using the callback.
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
+ * @return static
+ */
+ public function intersectUsing($items, callable $callback)
+ {
+ return new static(array_uintersect($this->items, $this->getArrayableItems($items), $callback));
+ }
+
+ /**
+ * Intersect the collection with the given items with additional index check.
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @return static
+ */
+ public function intersectAssoc($items)
+ {
+ return new static(array_intersect_assoc($this->items, $this->getArrayableItems($items)));
+ }
+
+ /**
+ * Intersect the collection with the given items with additional index check, using the callback.
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
+ * @return static
+ */
+ public function intersectAssocUsing($items, callable $callback)
+ {
+ return new static(array_intersect_uassoc($this->items, $this->getArrayableItems($items), $callback));
+ }
+
/**
* Intersect the collection with the given items by key.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function intersectByKeys($items)
@@ -651,7 +722,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the keys of the collection items.
*
- * @return static
+ * @return static<int, TKey>
*/
public function keys()
{
@@ -661,9 +732,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the last item from the collection.
*
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
+ * @template TLastDefault
+ *
+ * @param (callable(TValue, TKey): bool)|null $callback
+ * @param TLastDefault|(\Closure(): TLastDefault) $default
+ * @return TValue|TLastDefault
*/
public function last(callable $callback = null, $default = null)
{
@@ -673,9 +746,9 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the values of a given key.
*
- * @param string|array|int|null $value
+ * @param string|int|array<array-key, string> $value
* @param string|null $key
- * @return static
+ * @return static<array-key, mixed>
*/
public function pluck($value, $key = null)
{
@@ -685,16 +758,14 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Run a map over each of the items.
*
- * @param callable $callback
- * @return static
+ * @template TMapValue
+ *
+ * @param callable(TValue, TKey): TMapValue $callback
+ * @return static<TKey, TMapValue>
*/
public function map(callable $callback)
{
- $keys = array_keys($this->items);
-
- $items = array_map($callback, $this->items, $keys);
-
- return new static(array_combine($keys, $items));
+ return new static(Arr::map($this->items, $callback));
}
/**
@@ -702,8 +773,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapToDictionaryKey of array-key
+ * @template TMapToDictionaryValue
+ *
+ * @param callable(TValue, TKey): array<TMapToDictionaryKey, TMapToDictionaryValue> $callback
+ * @return static<TMapToDictionaryKey, array<int, TMapToDictionaryValue>>
*/
public function mapToDictionary(callable $callback)
{
@@ -731,8 +805,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapWithKeysKey of array-key
+ * @template TMapWithKeysValue
+ *
+ * @param callable(TValue, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback
+ * @return static<TMapWithKeysKey, TMapWithKeysValue>
*/
public function mapWithKeys(callable $callback)
{
@@ -752,7 +829,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Merge the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function merge($items)
@@ -763,8 +840,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Recursively merge the collection with the given items.
*
- * @param mixed $items
- * @return static
+ * @template TMergeRecursiveValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TMergeRecursiveValue>|iterable<TKey, TMergeRecursiveValue> $items
+ * @return static<TKey, TValue|TMergeRecursiveValue>
*/
public function mergeRecursive($items)
{
@@ -774,8 +853,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Create a collection by using this collection for keys and another for its values.
*
- * @param mixed $values
- * @return static
+ * @template TCombineValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
+ * @return static<TValue, TCombineValue>
*/
public function combine($values)
{
@@ -785,7 +866,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Union the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function union($items)
@@ -806,8 +887,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
$position = 0;
- foreach ($this->items as $item) {
- if ($position % $step === $offset) {
+ foreach ($this->slice($offset)->items as $item) {
+ if ($position % $step === 0) {
$new[] = $item;
}
@@ -820,7 +901,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the items with the specified keys.
*
- * @param mixed $keys
+ * @param \Tightenco\Collect\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string|null $keys
* @return static
*/
public function only($keys)
@@ -842,7 +923,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Get and remove the last N items from the collection.
*
* @param int $count
- * @return mixed
+ * @return static<int, TValue>|TValue|null
*/
public function pop($count = 1)
{
@@ -868,8 +949,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Push an item onto the beginning of the collection.
*
- * @param mixed $value
- * @param mixed $key
+ * @param TValue $value
+ * @param TKey $key
* @return $this
*/
public function prepend($value, $key = null)
@@ -882,7 +963,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Push one or more items onto the end of the collection.
*
- * @param mixed $values
+ * @param TValue ...$values
* @return $this
*/
public function push(...$values)
@@ -897,7 +978,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Push all of the given items onto the collection.
*
- * @param iterable $source
+ * @param iterable<array-key, TValue> $source
* @return static
*/
public function concat($source)
@@ -914,9 +995,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get and remove an item from the collection.
*
- * @param mixed $key
- * @param mixed $default
- * @return mixed
+ * @template TPullDefault
+ *
+ * @param TKey $key
+ * @param TPullDefault|(\Closure(): TPullDefault) $default
+ * @return TValue|TPullDefault
*/
public function pull($key, $default = null)
{
@@ -926,8 +1009,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Put an item in the collection by key.
*
- * @param mixed $key
- * @param mixed $value
+ * @param TKey $key
+ * @param TValue $value
* @return $this
*/
public function put($key, $value)
@@ -940,8 +1023,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get one or a specified number of items randomly from the collection.
*
- * @param int|null $number
- * @return static|mixed
+ * @param (callable(self<TKey, TValue>): int)|int|null $number
+ * @return static<int, TValue>|TValue
*
* @throws \InvalidArgumentException
*/
@@ -951,13 +1034,17 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
return Arr::random($this->items);
}
+ if (is_callable($number)) {
+ return new static(Arr::random($this->items, $number($this)));
+ }
+
return new static(Arr::random($this->items, $number));
}
/**
* Replace the collection items with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function replace($items)
@@ -968,7 +1055,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Recursively replace the collection items with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function replaceRecursive($items)
@@ -989,9 +1076,9 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Search the collection for a given value and return the corresponding key if successful.
*
- * @param mixed $value
+ * @param TValue|(callable(TValue,TKey): bool) $value
* @param bool $strict
- * @return mixed
+ * @return TKey|bool
*/
public function search($value, $strict = false)
{
@@ -1012,7 +1099,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Get and remove the first N items from the collection.
*
* @param int $count
- * @return mixed
+ * @return static<int, TValue>|TValue|null
*/
public function shift($count = 1)
{
@@ -1051,7 +1138,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* @param int $size
* @param int $step
- * @return static
+ * @return static<int, static>
*/
public function sliding($size = 2, $step = 1)
{
@@ -1076,7 +1163,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Skip items in the collection until the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function skipUntil($value)
@@ -1087,7 +1174,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Skip items in the collection while the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function skipWhile($value)
@@ -1111,7 +1198,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Split a collection into a certain number of groups.
*
* @param int $numberOfGroups
- * @return static
+ * @return static<int, static>
*/
public function split($numberOfGroups)
{
@@ -1148,7 +1235,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Split a collection into a certain number of groups, and fill the first groups completely.
*
* @param int $numberOfGroups
- * @return static
+ * @return static<int, static>
*/
public function splitIn($numberOfGroups)
{
@@ -1158,10 +1245,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|string $key
* @param mixed $operator
* @param mixed $value
- * @return mixed
+ * @return TValue
*
* @throws \Tightenco\Collect\Support\ItemNotFoundException
* @throws \Tightenco\Collect\Support\MultipleItemsFoundException
@@ -1172,14 +1259,16 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
? $this->operatorForWhere(...func_get_args())
: $key;
- $items = $this->when($filter)->filter($filter);
+ $items = $this->unless($filter == null)->filter($filter);
+
+ $count = $items->count();
- if ($items->isEmpty()) {
+ if ($count === 0) {
throw new ItemNotFoundException;
}
- if ($items->count() > 1) {
- throw new MultipleItemsFoundException;
+ if ($count > 1) {
+ throw new MultipleItemsFoundException($count);
}
return $items->first();
@@ -1188,10 +1277,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get the first item in the collection but throw an exception if no matching items exist.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|string $key
* @param mixed $operator
* @param mixed $value
- * @return mixed
+ * @return TValue
*
* @throws \Tightenco\Collect\Support\ItemNotFoundException
*/
@@ -1216,7 +1305,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* Chunk the collection into chunks of the given size.
*
* @param int $size
- * @return static
+ * @return static<int, static>
*/
public function chunk($size)
{
@@ -1236,8 +1325,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Chunk the collection into chunks with a callback.
*
- * @param callable $callback
- * @return static
+ * @param callable(TValue, TKey, static<int, TValue>): bool $callback
+ * @return static<int, static<int, TValue>>
*/
public function chunkWhile(callable $callback)
{
@@ -1249,7 +1338,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Sort through each item with a callback.
*
- * @param callable|int|null $callback
+ * @param (callable(TValue, TValue): int)|null|int $callback
* @return static
*/
public function sort($callback = null)
@@ -1281,7 +1370,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Sort the collection using the given callback.
*
- * @param callable|array|string $callback
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}>|(callable(TValue, TKey): mixed)|string $callback
* @param int $options
* @param bool $descending
* @return static
@@ -1319,14 +1408,14 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Sort the collection using multiple comparisons.
*
- * @param array $comparisons
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}> $comparisons
* @return static
*/
protected function sortByMany(array $comparisons = [])
{
$items = $this->items;
- usort($items, function ($a, $b) use ($comparisons) {
+ uasort($items, function ($a, $b) use ($comparisons) {
foreach ($comparisons as $comparison) {
$comparison = Arr::wrap($comparison);
@@ -1335,8 +1424,6 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
$ascending = Arr::get($comparison, 1, true) === true ||
Arr::get($comparison, 1, true) === 'asc';
- $result = 0;
-
if (! is_string($prop) && is_callable($prop)) {
$result = $prop($a, $b);
} else {
@@ -1363,7 +1450,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Sort the collection in descending order using the given callback.
*
- * @param callable|string $callback
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}>|(callable(TValue, TKey): mixed)|string $callback
* @param int $options
* @return static
*/
@@ -1402,7 +1489,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Sort the collection keys using a callback.
*
- * @param callable $callback
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function sortKeysUsing(callable $callback)
@@ -1419,7 +1506,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* @param int $offset
* @param int|null $length
- * @param mixed $replacement
+ * @param array<array-key, TValue> $replacement
* @return static
*/
public function splice($offset, $length = null, $replacement = [])
@@ -1449,7 +1536,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Take items in the collection until the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function takeUntil($value)
@@ -1460,7 +1547,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Take items in the collection while the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function takeWhile($value)
@@ -1471,7 +1558,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Transform each item in the collection using a callback.
*
- * @param callable $callback
+ * @param callable(TValue, TKey): TValue $callback
* @return $this
*/
public function transform(callable $callback)
@@ -1494,7 +1581,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Return only unique items from the collection array.
*
- * @param string|callable|null $key
+ * @param (callable(TValue, TKey): mixed)|string|null $key
* @param bool $strict
* @return static
*/
@@ -1520,7 +1607,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Reset the keys on the underlying array.
*
- * @return static
+ * @return static<int, TValue>
*/
public function values()
{
@@ -1533,18 +1620,16 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
* e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
* => [[1, 4], [2, 5], [3, 6]]
*
- * @param mixed ...$items
- * @return static
+ * @template TZipValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items
+ * @return static<int, static<int, TValue|TZipValue>>
*/
public function zip($items)
{
- $arrayableItems = array_map(function ($items) {
- return $this->getArrayableItems($items);
- }, func_get_args());
+ $arrayableItems = array_map(fn ($items) => $this->getArrayableItems($items), func_get_args());
- $params = array_merge([function () {
- return new static(func_get_args());
- }, $this->items], $arrayableItems);
+ $params = array_merge([fn () => new static(func_get_args()), $this->items], $arrayableItems);
return new static(array_map(...$params));
}
@@ -1552,9 +1637,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Pad collection to the specified length with a value.
*
+ * @template TPadValue
+ *
* @param int $size
- * @param mixed $value
- * @return static
+ * @param TPadValue $value
+ * @return static<int, TValue|TPadValue>
*/
public function pad($size, $value)
{
@@ -1564,10 +1651,9 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get an iterator for the items.
*
- * @return \ArrayIterator
+ * @return \ArrayIterator<TKey, TValue>
*/
- #[\ReturnTypeWillChange]
- public function getIterator()
+ public function getIterator(): Traversable
{
return new ArrayIterator($this->items);
}
@@ -1577,8 +1663,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
*
* @return int
*/
- #[\ReturnTypeWillChange]
- public function count()
+ public function count(): int
{
return count($this->items);
}
@@ -1586,8 +1671,8 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Count the number of items in the collection by a field or using a callback.
*
- * @param callable|string $countBy
- * @return static
+ * @param (callable(TValue, TKey): array-key)|string|null $countBy
+ * @return static<array-key, int>
*/
public function countBy($countBy = null)
{
@@ -1597,7 +1682,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Add an item to the collection.
*
- * @param mixed $item
+ * @param TValue $item
* @return $this
*/
public function add($item)
@@ -1610,7 +1695,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get a base Support collection instance from this collection.
*
- * @return \Tightenco\Collect\Support\Collection
+ * @return \Tightenco\Collect\Support\Collection<TKey, TValue>
*/
public function toBase()
{
@@ -1620,11 +1705,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Determine if an item exists at an offset.
*
- * @param mixed $key
+ * @param TKey $key
* @return bool
*/
- #[\ReturnTypeWillChange]
- public function offsetExists($key)
+ public function offsetExists($key): bool
{
return isset($this->items[$key]);
}
@@ -1632,11 +1716,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Get an item at a given offset.
*
- * @param mixed $key
- * @return mixed
+ * @param TKey $key
+ * @return TValue
*/
- #[\ReturnTypeWillChange]
- public function offsetGet($key)
+ public function offsetGet($key): mixed
{
return $this->items[$key];
}
@@ -1644,12 +1727,11 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Set the item at a given offset.
*
- * @param mixed $key
- * @param mixed $value
+ * @param TKey|null $key
+ * @param TValue $value
* @return void
*/
- #[\ReturnTypeWillChange]
- public function offsetSet($key, $value)
+ public function offsetSet($key, $value): void
{
if (is_null($key)) {
$this->items[] = $value;
@@ -1661,11 +1743,10 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl
/**
* Unset the item at a given offset.
*
- * @param mixed $key
+ * @param TKey $key
* @return void
*/
- #[\ReturnTypeWillChange]
- public function offsetUnset($key)
+ public function offsetUnset($key): void
{
unset($this->items[$key]);
}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php
index 60af386c..1f0db03a 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Enumerable.php
@@ -2,19 +2,31 @@
namespace Tightenco\Collect\Support;
+use CachingIterator;
use Countable;
use Tightenco\Collect\Contracts\Support\Arrayable;
use Tightenco\Collect\Contracts\Support\Jsonable;
use IteratorAggregate;
use JsonSerializable;
-
+use Traversable;
+
+/**
+ * @template TKey of array-key
+ * @template TValue
+ *
+ * @extends \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>
+ * @extends \IteratorAggregate<TKey, TValue>
+ */
interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable
{
/**
* Create a new collection instance if the value isn't one already.
*
- * @param mixed $items
- * @return static
+ * @template TMakeKey of array-key
+ * @template TMakeValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|null $items
+ * @return static<TMakeKey, TMakeValue>
*/
public static function make($items = []);
@@ -39,16 +51,21 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Wrap the given value in a collection if applicable.
*
- * @param mixed $value
- * @return static
+ * @template TWrapValue
+ *
+ * @param iterable<array-key, TWrapValue>|TWrapValue $value
+ * @return static<array-key, TWrapValue>
*/
public static function wrap($value);
/**
* Get the underlying items from the given collection if applicable.
*
- * @param array|static $value
- * @return array
+ * @template TUnwrapKey of array-key
+ * @template TUnwrapValue
+ *
+ * @param array<TUnwrapKey, TUnwrapValue>|static<TUnwrapKey, TUnwrapValue> $value
+ * @return array<TUnwrapKey, TUnwrapValue>
*/
public static function unwrap($value);
@@ -69,38 +86,38 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Alias for the "avg" method.
*
- * @param callable|string|null $callback
- * @return mixed
+ * @param (callable(TValue): float|int)|string|null $callback
+ * @return float|int|null
*/
public function average($callback = null);
/**
* Get the median of a given key.
*
- * @param string|array|null $key
- * @return mixed
+ * @param string|array<array-key, string>|null $key
+ * @return float|int|null
*/
public function median($key = null);
/**
* Get the mode of a given key.
*
- * @param string|array|null $key
- * @return array|null
+ * @param string|array<array-key, string>|null $key
+ * @return array<int, float|int>|null
*/
public function mode($key = null);
/**
* Collapse the items into a single enumerable.
*
- * @return static
+ * @return static<int, mixed>
*/
public function collapse();
/**
* Alias for the "contains" method.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
@@ -110,8 +127,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Determine if an item exists, using strict comparison.
*
- * @param mixed $key
- * @param mixed $value
+ * @param (callable(TValue): bool)|TValue|array-key $key
+ * @param TValue|null $value
* @return bool
*/
public function containsStrict($key, $value = null);
@@ -119,26 +136,39 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the average value of a given key.
*
- * @param callable|string|null $callback
- * @return mixed
+ * @param (callable(TValue): float|int)|string|null $callback
+ * @return float|int|null
*/
public function avg($callback = null);
/**
* Determine if an item exists in the enumerable.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
*/
public function contains($key, $operator = null, $value = null);
+ /**
+ * Determine if an item is not contained in the collection.
+ *
+ * @param mixed $key
+ * @param mixed $operator
+ * @param mixed $value
+ * @return bool
+ */
+ public function doesntContain($key, $operator = null, $value = null);
+
/**
* Cross join with the given lists, returning all possible permutations.
*
- * @param mixed ...$lists
- * @return static
+ * @template TCrossJoinKey
+ * @template TCrossJoinValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TCrossJoinKey, TCrossJoinValue>|iterable<TCrossJoinKey, TCrossJoinValue> ...$lists
+ * @return static<int, array<int, TValue|TCrossJoinValue>>
*/
public function crossJoin(...$lists);
@@ -146,7 +176,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Dump the collection and end the script.
*
* @param mixed ...$args
- * @return void
+ * @return never
*/
public function dd(...$args);
@@ -160,7 +190,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items that are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
* @return static
*/
public function diff($items);
@@ -168,8 +198,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items that are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
* @return static
*/
public function diffUsing($items, callable $callback);
@@ -177,7 +207,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items whose keys and values are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function diffAssoc($items);
@@ -185,8 +215,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items whose keys and values are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function diffAssocUsing($items, callable $callback);
@@ -194,7 +224,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items whose keys are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function diffKeys($items);
@@ -202,8 +232,8 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items whose keys are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function diffKeysUsing($items, callable $callback);
@@ -211,7 +241,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Retrieve duplicate items.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): bool)|string|null $callback
* @param bool $strict
* @return static
*/
@@ -220,7 +250,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Retrieve duplicate items using strict comparison.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): bool)|string|null $callback
* @return static
*/
public function duplicatesStrict($callback = null);
@@ -228,7 +258,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Execute a callback over each item.
*
- * @param callable $callback
+ * @param callable(TValue, TKey): mixed $callback
* @return $this
*/
public function each(callable $callback);
@@ -244,7 +274,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Determine if all items pass the given truth test.
*
- * @param string|callable $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
@@ -254,7 +284,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get all items except for those with the specified keys.
*
- * @param mixed $keys
+ * @param \Tightenco\Collect\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys
* @return static
*/
public function except($keys);
@@ -262,64 +292,76 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Run a filter over each of the items.
*
- * @param callable|null $callback
+ * @param (callable(TValue): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null);
/**
- * Apply the callback if the value is truthy.
+ * Apply the callback if the given "value" is (or resolves to) truthy.
+ *
+ * @template TWhenReturnType as null
*
* @param bool $value
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @param (callable($this): TWhenReturnType)|null $callback
+ * @param (callable($this): TWhenReturnType)|null $default
+ * @return $this|TWhenReturnType
*/
- public function when($value, callable $callback, callable $default = null);
+ public function when($value, callable $callback = null, callable $default = null);
/**
* Apply the callback if the collection is empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TWhenEmptyReturnType
+ *
+ * @param (callable($this): TWhenEmptyReturnType) $callback
+ * @param (callable($this): TWhenEmptyReturnType)|null $default
+ * @return $this|TWhenEmptyReturnType
*/
public function whenEmpty(callable $callback, callable $default = null);
/**
* Apply the callback if the collection is not empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TWhenNotEmptyReturnType
+ *
+ * @param callable($this): TWhenNotEmptyReturnType $callback
+ * @param (callable($this): TWhenNotEmptyReturnType)|null $default
+ * @return $this|TWhenNotEmptyReturnType
*/
public function whenNotEmpty(callable $callback, callable $default = null);
/**
- * Apply the callback if the value is falsy.
+ * Apply the callback if the given "value" is (or resolves to) truthy.
+ *
+ * @template TUnlessReturnType
*
* @param bool $value
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @param (callable($this): TUnlessReturnType) $callback
+ * @param (callable($this): TUnlessReturnType)|null $default
+ * @return $this|TUnlessReturnType
*/
public function unless($value, callable $callback, callable $default = null);
/**
* Apply the callback unless the collection is empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TUnlessEmptyReturnType
+ *
+ * @param callable($this): TUnlessEmptyReturnType $callback
+ * @param (callable($this): TUnlessEmptyReturnType)|null $default
+ * @return $this|TUnlessEmptyReturnType
*/
public function unlessEmpty(callable $callback, callable $default = null);
/**
* Apply the callback unless the collection is not empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TUnlessNotEmptyReturnType
+ *
+ * @param callable($this): TUnlessNotEmptyReturnType $callback
+ * @param (callable($this): TUnlessNotEmptyReturnType)|null $default
+ * @return $this|TUnlessNotEmptyReturnType
*/
public function unlessNotEmpty(callable $callback, callable $default = null);
@@ -362,7 +404,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Filter items by the given key value pair.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @param bool $strict
* @return static
*/
@@ -372,7 +414,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Filter items by the given key value pair using strict comparison.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereInStrict($key, $values);
@@ -381,7 +423,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Filter items such that the value of the given key is between the given values.
*
* @param string $key
- * @param array $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereBetween($key, $values);
@@ -390,7 +432,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Filter items such that the value of the given key is not between the given values.
*
* @param string $key
- * @param array $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereNotBetween($key, $values);
@@ -399,7 +441,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Filter items by the given key value pair.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @param bool $strict
* @return static
*/
@@ -409,7 +451,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Filter items by the given key value pair using strict comparison.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereNotInStrict($key, $values);
@@ -417,17 +459,21 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Filter the items, removing any items that don't match the given type(s).
*
- * @param string|string[] $type
- * @return static
+ * @template TWhereInstanceOf
+ *
+ * @param class-string<TWhereInstanceOf>|array<array-key, class-string<TWhereInstanceOf>> $type
+ * @return static<TKey, TWhereInstanceOf>
*/
public function whereInstanceOf($type);
/**
* Get the first item from the enumerable passing the given truth test.
*
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
+ * @template TFirstDefault
+ *
+ * @param (callable(TValue,TKey): bool)|null $callback
+ * @param TFirstDefault|(\Closure(): TFirstDefault) $default
+ * @return TValue|TFirstDefault
*/
public function first(callable $callback = null, $default = null);
@@ -437,7 +483,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* @param string $key
* @param mixed $operator
* @param mixed $value
- * @return mixed
+ * @return TValue|null
*/
public function firstWhere($key, $operator = null, $value = null);
@@ -452,44 +498,54 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Flip the values with their keys.
*
- * @return static
+ * @return static<TValue, TKey>
*/
public function flip();
/**
* Get an item from the collection by key.
*
- * @param mixed $key
- * @param mixed $default
- * @return mixed
+ * @template TGetDefault
+ *
+ * @param TKey $key
+ * @param TGetDefault|(\Closure(): TGetDefault) $default
+ * @return TValue|TGetDefault
*/
public function get($key, $default = null);
/**
* Group an associative array by a field or using a callback.
*
- * @param array|callable|string $groupBy
+ * @param (callable(TValue, TKey): array-key)|array|string $groupBy
* @param bool $preserveKeys
- * @return static
+ * @return static<array-key, static<array-key, TValue>>
*/
public function groupBy($groupBy, $preserveKeys = false);
/**
* Key an associative array by a field or using a callback.
*
- * @param callable|string $keyBy
- * @return static
+ * @param (callable(TValue, TKey): array-key)|array|string $keyBy
+ * @return static<array-key, TValue>
*/
public function keyBy($keyBy);
/**
* Determine if an item exists in the collection by key.
*
- * @param mixed $key
+ * @param TKey|array<array-key, TKey> $key
* @return bool
*/
public function has($key);
+ /**
+ * Determine if any of the keys exist in the collection.
+ *
+ * @param mixed $key
+ * @return bool
+ */
+ public function hasAny($key);
+
/**
* Concatenate values of a given key as a string.
*
@@ -502,7 +558,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Intersect the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function intersect($items);
@@ -510,7 +566,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Intersect the collection with the given items by key.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function intersectByKeys($items);
@@ -529,6 +585,13 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*/
public function isNotEmpty();
+ /**
+ * Determine if the collection contains a single item.
+ *
+ * @return bool
+ */
+ public function containsOneItem();
+
/**
* Join all items from the collection using a string. The final items can use a separate glue string.
*
@@ -541,24 +604,28 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the keys of the collection items.
*
- * @return static
+ * @return static<int, TKey>
*/
public function keys();
/**
* Get the last item from the collection.
*
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
+ * @template TLastDefault
+ *
+ * @param (callable(TValue, TKey): bool)|null $callback
+ * @param TLastDefault|(\Closure(): TLastDefault) $default
+ * @return TValue|TLastDefault
*/
public function last(callable $callback = null, $default = null);
/**
* Run a map over each of the items.
*
- * @param callable $callback
- * @return static
+ * @template TMapValue
+ *
+ * @param callable(TValue, TKey): TMapValue $callback
+ * @return static<TKey, TMapValue>
*/
public function map(callable $callback);
@@ -575,8 +642,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapToDictionaryKey of array-key
+ * @template TMapToDictionaryValue
+ *
+ * @param callable(TValue, TKey): array<TMapToDictionaryKey, TMapToDictionaryValue> $callback
+ * @return static<TMapToDictionaryKey, array<int, TMapToDictionaryValue>>
*/
public function mapToDictionary(callable $callback);
@@ -585,8 +655,11 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapToGroupsKey of array-key
+ * @template TMapToGroupsValue
+ *
+ * @param callable(TValue, TKey): array<TMapToGroupsKey, TMapToGroupsValue> $callback
+ * @return static<TMapToGroupsKey, static<int, TMapToGroupsValue>>
*/
public function mapToGroups(callable $callback);
@@ -595,31 +668,39 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapWithKeysKey of array-key
+ * @template TMapWithKeysValue
+ *
+ * @param callable(TValue, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback
+ * @return static<TMapWithKeysKey, TMapWithKeysValue>
*/
public function mapWithKeys(callable $callback);
/**
* Map a collection and flatten the result by a single level.
*
- * @param callable $callback
- * @return static
+ * @template TFlatMapKey of array-key
+ * @template TFlatMapValue
+ *
+ * @param callable(TValue, TKey): (\Tightenco\Collect\Support\Collection<TFlatMapKey, TFlatMapValue>|array<TFlatMapKey, TFlatMapValue>) $callback
+ * @return static<TFlatMapKey, TFlatMapValue>
*/
public function flatMap(callable $callback);
/**
* Map the values into a new class.
*
- * @param string $class
- * @return static
+ * @template TMapIntoValue
+ *
+ * @param class-string<TMapIntoValue> $class
+ * @return static<TKey, TMapIntoValue>
*/
public function mapInto($class);
/**
* Merge the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function merge($items);
@@ -627,23 +708,27 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Recursively merge the collection with the given items.
*
- * @param mixed $items
- * @return static
+ * @template TMergeRecursiveValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TMergeRecursiveValue>|iterable<TKey, TMergeRecursiveValue> $items
+ * @return static<TKey, TValue|TMergeRecursiveValue>
*/
public function mergeRecursive($items);
/**
* Create a collection by using this collection for keys and another for its values.
*
- * @param mixed $values
- * @return static
+ * @template TCombineValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TCombineValue>|iterable<array-key, TCombineValue> $values
+ * @return static<TValue, TCombineValue>
*/
public function combine($values);
/**
* Union the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function union($items);
@@ -651,7 +736,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the min value of a given key.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue):mixed)|string|null $callback
* @return mixed
*/
public function min($callback = null);
@@ -659,7 +744,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the max value of a given key.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue):mixed)|string|null $callback
* @return mixed
*/
public function max($callback = null);
@@ -676,7 +761,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Get the items with the specified keys.
*
- * @param mixed $keys
+ * @param \Tightenco\Collect\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string $keys
* @return static
*/
public function only($keys);
@@ -693,17 +778,17 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Partition the collection into two arrays using the given callback or key.
*
- * @param callable|string $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
- * @return static
+ * @return static<int<0, 1>, static<TKey, TValue>>
*/
public function partition($key, $operator = null, $value = null);
/**
* Push all of the given items onto the collection.
*
- * @param iterable $source
+ * @param iterable<array-key, TValue> $source
* @return static
*/
public function concat($source);
@@ -712,7 +797,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Get one or a specified number of items randomly from the collection.
*
* @param int|null $number
- * @return static|mixed
+ * @return static<int, TValue>|TValue
*
* @throws \InvalidArgumentException
*/
@@ -721,16 +806,30 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Reduce the collection to a single value.
*
- * @param callable $callback
- * @param mixed $initial
- * @return mixed
+ * @template TReduceInitial
+ * @template TReduceReturnType
+ *
+ * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback
+ * @param TReduceInitial $initial
+ * @return TReduceReturnType
*/
public function reduce(callable $callback, $initial = null);
+ /**
+ * Reduce the collection to multiple aggregate values.
+ *
+ * @param callable $callback
+ * @param mixed ...$initial
+ * @return array
+ *
+ * @throws \UnexpectedValueException
+ */
+ public function reduceSpread(callable $callback, ...$initial);
+
/**
* Replace the collection items with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function replace($items);
@@ -738,7 +837,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Recursively replace the collection items with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function replaceRecursive($items);
@@ -753,9 +852,9 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Search the collection for a given value and return the corresponding key if successful.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @param bool $strict
- * @return mixed
+ * @return TKey|bool
*/
public function search($value, $strict = false);
@@ -767,6 +866,15 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*/
public function shuffle($seed = null);
+ /**
+ * Create chunks representing a "sliding window" view of the items in the collection.
+ *
+ * @param int $size
+ * @param int $step
+ * @return static<int, static>
+ */
+ public function sliding($size = 2, $step = 1);
+
/**
* Skip the first {$count} items.
*
@@ -778,7 +886,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Skip items in the collection until the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function skipUntil($value);
@@ -786,7 +894,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Skip items in the collection while the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function skipWhile($value);
@@ -804,30 +912,63 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* Split a collection into a certain number of groups.
*
* @param int $numberOfGroups
- * @return static
+ * @return static<int, static>
*/
public function split($numberOfGroups);
+ /**
+ * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
+ *
+ * @param (callable(TValue, TKey): bool)|string $key
+ * @param mixed $operator
+ * @param mixed $value
+ * @return TValue
+ *
+ * @throws \Tightenco\Collect\Support\ItemNotFoundException
+ * @throws \Tightenco\Collect\Support\MultipleItemsFoundException
+ */
+ public function sole($key = null, $operator = null, $value = null);
+
+ /**
+ * Get the first item in the collection but throw an exception if no matching items exist.
+ *
+ * @param (callable(TValue, TKey): bool)|string $key
+ * @param mixed $operator
+ * @param mixed $value
+ * @return TValue
+ *
+ * @throws \Tightenco\Collect\Support\ItemNotFoundException
+ */
+ public function firstOrFail($key = null, $operator = null, $value = null);
+
/**
* Chunk the collection into chunks of the given size.
*
* @param int $size
- * @return static
+ * @return static<int, static>
*/
public function chunk($size);
/**
* Chunk the collection into chunks with a callback.
*
- * @param callable $callback
- * @return static
+ * @param callable(TValue, TKey, static<int, TValue>): bool $callback
+ * @return static<int, static<int, TValue>>
*/
public function chunkWhile(callable $callback);
+ /**
+ * Split a collection into a certain number of groups, and fill the first groups completely.
+ *
+ * @param int $numberOfGroups
+ * @return static<int, static>
+ */
+ public function splitIn($numberOfGroups);
+
/**
* Sort through each item with a callback.
*
- * @param callable|null|int $callback
+ * @param (callable(TValue, TValue): int)|null|int $callback
* @return static
*/
public function sort($callback = null);
@@ -843,7 +984,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Sort the collection using the given callback.
*
- * @param callable|string $callback
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}>|(callable(TValue, TKey): mixed)|string $callback
* @param int $options
* @param bool $descending
* @return static
@@ -853,7 +994,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Sort the collection in descending order using the given callback.
*
- * @param callable|string $callback
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}>|(callable(TValue, TKey): mixed)|string $callback
* @param int $options
* @return static
*/
@@ -876,10 +1017,18 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*/
public function sortKeysDesc($options = SORT_REGULAR);
+ /**
+ * Sort the collection keys using a callback.
+ *
+ * @param callable(TKey, TKey): int $callback
+ * @return static
+ */
+ public function sortKeysUsing(callable $callback);
+
/**
* Get the sum of the given values.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): mixed)|string|null $callback
* @return mixed
*/
public function sum($callback = null);
@@ -895,7 +1044,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Take items in the collection until the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function takeUntil($value);
@@ -903,7 +1052,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Take items in the collection while the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function takeWhile($value);
@@ -911,7 +1060,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Pass the collection to the given callback and then return it.
*
- * @param callable $callback
+ * @param callable(TValue): mixed $callback
* @return $this
*/
public function tap(callable $callback);
@@ -919,32 +1068,57 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Pass the enumerable to the given callback and return the result.
*
- * @param callable $callback
- * @return mixed
+ * @template TPipeReturnType
+ *
+ * @param callable($this): TPipeReturnType $callback
+ * @return TPipeReturnType
*/
public function pipe(callable $callback);
+ /**
+ * Pass the collection into a new class.
+ *
+ * @param class-string $class
+ * @return mixed
+ */
+ public function pipeInto($class);
+
+ /**
+ * Pass the collection through a series of callable pipes and return the result.
+ *
+ * @param array<callable> $pipes
+ * @return mixed
+ */
+ public function pipeThrough($pipes);
+
/**
* Get the values of a given key.
*
- * @param string|array $value
+ * @param string|array<array-key, string> $value
* @param string|null $key
- * @return static
+ * @return static<int, mixed>
*/
public function pluck($value, $key = null);
/**
* Create a collection of all elements that do not pass a given truth test.
*
- * @param callable|mixed $callback
+ * @param (callable(TValue, TKey): bool)|bool|TValue $callback
* @return static
*/
public function reject($callback = true);
+ /**
+ * Convert a flatten "dot" notation array into an expanded array.
+ *
+ * @return static
+ */
+ public function undot();
+
/**
* Return only unique items from the collection array.
*
- * @param string|callable|null $key
+ * @param (callable(TValue, TKey): mixed)|string|null $key
* @param bool $strict
* @return static
*/
@@ -953,7 +1127,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Return only unique items from the collection array using strict comparison.
*
- * @param string|callable|null $key
+ * @param (callable(TValue, TKey): mixed)|string|null $key
* @return static
*/
public function uniqueStrict($key = null);
@@ -961,26 +1135,42 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
/**
* Reset the keys on the underlying array.
*
- * @return static
+ * @return static<int, TValue>
*/
public function values();
/**
* Pad collection to the specified length with a value.
*
+ * @template TPadValue
+ *
* @param int $size
- * @param mixed $value
- * @return static
+ * @param TPadValue $value
+ * @return static<int, TValue|TPadValue>
*/
public function pad($size, $value);
/**
- * Count the number of items in the collection using a given truth test.
+ * Get the values iterator.
*
- * @param callable|null $callback
- * @return static
+ * @return \Traversable<TKey, TValue>
*/
- public function countBy($callback = null);
+ public function getIterator(): Traversable;
+
+ /**
+ * Count the number of items in the collection.
+ *
+ * @return int
+ */
+ public function count(): int;
+
+ /**
+ * Count the number of items in the collection by a field or using a callback.
+ *
+ * @param (callable(TValue, TKey): array-key)|string|null $countBy
+ * @return static<array-key, int>
+ */
+ public function countBy($countBy = null);
/**
* Zip the collection together with one or more arrays.
@@ -988,18 +1178,50 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
* e.g. new Collection([1, 2, 3])->zip([4, 5, 6]);
* => [[1, 4], [2, 5], [3, 6]]
*
- * @param mixed ...$items
- * @return static
+ * @template TZipValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items
+ * @return static<int, static<int, TValue|TZipValue>>
*/
public function zip($items);
/**
* Collect the values into a collection.
*
- * @return \Tightenco\Collect\Support\Collection
+ * @return \Tightenco\Collect\Support\Collection<TKey, TValue>
*/
public function collect();
+ /**
+ * Get the collection of items as a plain array.
+ *
+ * @return array<TKey, mixed>
+ */
+ public function toArray();
+
+ /**
+ * Convert the object into something JSON serializable.
+ *
+ * @return mixed
+ */
+ public function jsonSerialize(): mixed;
+
+ /**
+ * Get the collection of items as JSON.
+ *
+ * @param int $options
+ * @return string
+ */
+ public function toJson($options = 0);
+
+ /**
+ * Get a CachingIterator instance.
+ *
+ * @param int $flags
+ * @return \CachingIterator
+ */
+ public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING);
+
/**
* Convert the collection to its string representation.
*
@@ -1007,6 +1229,14 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable,
*/
public function __toString();
+ /**
+ * Indicate that the model's string representation should be escaped when __toString is invoked.
+ *
+ * @param bool $escape
+ * @return $this
+ */
+ public function escapeWhenCastingToString($escape = true);
+
/**
* Add a method to the list of proxied methods.
*
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php
deleted file mode 100644
index ea48c7c5..00000000
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/HigherOrderWhenProxy.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-namespace Tightenco\Collect\Support;
-
-/**
- * @mixin \Tightenco\Collect\Support\Enumerable
- */
-class HigherOrderWhenProxy
-{
- /**
- * The collection being operated on.
- *
- * @var \Tightenco\Collect\Support\Enumerable
- */
- protected $collection;
-
- /**
- * The condition for proxying.
- *
- * @var bool
- */
- protected $condition;
-
- /**
- * Create a new proxy instance.
- *
- * @param \Tightenco\Collect\Support\Enumerable $collection
- * @param bool $condition
- * @return void
- */
- public function __construct(Enumerable $collection, $condition)
- {
- $this->condition = $condition;
- $this->collection = $collection;
- }
-
- /**
- * Proxy accessing an attribute onto the collection.
- *
- * @param string $key
- * @return mixed
- */
- public function __get($key)
- {
- return $this->condition
- ? $this->collection->{$key}
- : $this->collection;
- }
-
- /**
- * Proxy a method call onto the collection.
- *
- * @param string $method
- * @param array $parameters
- * @return mixed
- */
- public function __call($method, $parameters)
- {
- return $this->condition
- ? $this->collection->{$method}(...$parameters)
- : $this->collection;
- }
-}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php
index 464cee1b..07327cb1 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/LazyCollection.php
@@ -5,27 +5,39 @@ namespace Tightenco\Collect\Support;
use ArrayIterator;
use Closure;
use DateTimeInterface;
+use Generator;
use Tightenco\Collect\Contracts\Support\CanBeEscapedWhenCastToString;
use Tightenco\Collect\Support\Traits\EnumeratesValues;
use Tightenco\Collect\Support\Traits\Macroable;
+use InvalidArgumentException;
use IteratorAggregate;
use stdClass;
-
+use Traversable;
+
+/**
+ * @template TKey of array-key
+ * @template TValue
+ *
+ * @implements \Tightenco\Collect\Support\Enumerable<TKey, TValue>
+ */
class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
{
+ /**
+ * @use \Tightenco\Collect\Support\Traits\EnumeratesValues<TKey, TValue>
+ */
use EnumeratesValues, Macroable;
/**
* The source from which to generate items.
*
- * @var callable|static
+ * @var (Closure(): \Generator<TKey, TValue, mixed, void>)|static|array<TKey, TValue>
*/
public $source;
/**
* Create a new lazy collection instance.
*
- * @param mixed $source
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>|(Closure(): \Generator<TKey, TValue, mixed, void>)|self<TKey, TValue>|array<TKey, TValue>|null $source
* @return void
*/
public function __construct($source = null)
@@ -34,17 +46,35 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
$this->source = $source;
} elseif (is_null($source)) {
$this->source = static::empty();
+ } elseif ($source instanceof Generator) {
+ throw new InvalidArgumentException(
+ 'Generators should not be passed directly to LazyCollection. Instead, pass a generator function.'
+ );
} else {
$this->source = $this->getArrayableItems($source);
}
}
+ /**
+ * Create a new collection instance if the value isn't one already.
+ *
+ * @template TMakeKey of array-key
+ * @template TMakeValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|(Closure(): \Generator<TMakeKey, TMakeValue, mixed, void>)|self<TMakeKey, TMakeValue>|array<TMakeKey, TMakeValue>|null $items
+ * @return static<TMakeKey, TMakeValue>
+ */
+ public static function make($items = [])
+ {
+ return new static($items);
+ }
+
/**
* Create a collection with the given range.
*
* @param int $from
* @param int $to
- * @return static
+ * @return static<int, int>
*/
public static function range($from, $to)
{
@@ -64,7 +94,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get all items in the enumerable.
*
- * @return array
+ * @return array<TKey, TValue>
*/
public function all()
{
@@ -126,8 +156,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the average value of a given key.
*
- * @param callable|string|null $callback
- * @return mixed
+ * @param (callable(TValue): float|int)|string|null $callback
+ * @return float|int|null
*/
public function avg($callback = null)
{
@@ -137,8 +167,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the median of a given key.
*
- * @param string|array|null $key
- * @return mixed
+ * @param string|array<array-key, string>|null $key
+ * @return float|int|null
*/
public function median($key = null)
{
@@ -148,8 +178,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the mode of a given key.
*
- * @param string|array|null $key
- * @return array|null
+ * @param string|array<string>|null $key
+ * @return array<int, float|int>|null
*/
public function mode($key = null)
{
@@ -159,7 +189,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Collapse the collection of items into a single array.
*
- * @return static
+ * @return static<int, mixed>
*/
public function collapse()
{
@@ -177,7 +207,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Determine if an item exists in the enumerable.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
@@ -187,6 +217,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
if (func_num_args() === 1 && $this->useAsCallable($key)) {
$placeholder = new stdClass;
+ /** @var callable $key */
return $this->first($key, $placeholder) !== $placeholder;
}
@@ -205,6 +236,32 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
return $this->contains($this->operatorForWhere(...func_get_args()));
}
+ /**
+ * Determine if an item exists, using strict comparison.
+ *
+ * @param (callable(TValue): bool)|TValue|array-key $key
+ * @param TValue|null $value
+ * @return bool
+ */
+ public function containsStrict($key, $value = null)
+ {
+ if (func_num_args() === 2) {
+ return $this->contains(fn ($item) => data_get($item, $key) === $value);
+ }
+
+ if ($this->useAsCallable($key)) {
+ return ! is_null($this->first($key));
+ }
+
+ foreach ($this as $item) {
+ if ($item === $key) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/**
* Determine if an item is not contained in the enumerable.
*
@@ -221,8 +278,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Cross join the given iterables, returning all possible permutations.
*
- * @param array ...$arrays
- * @return static
+ * @template TCrossJoinKey
+ * @template TCrossJoinValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TCrossJoinKey, TCrossJoinValue>|iterable<TCrossJoinKey, TCrossJoinValue> ...$arrays
+ * @return static<int, array<int, TValue|TCrossJoinValue>>
*/
public function crossJoin(...$arrays)
{
@@ -232,8 +292,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Count the number of items in the collection by a field or using a callback.
*
- * @param callable|string $countBy
- * @return static
+ * @param (callable(TValue, TKey): array-key)|string|null $countBy
+ * @return static<array-key, int>
*/
public function countBy($countBy = null)
{
@@ -261,7 +321,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items that are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
* @return static
*/
public function diff($items)
@@ -272,8 +332,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items that are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
* @return static
*/
public function diffUsing($items, callable $callback)
@@ -284,7 +344,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items whose keys and values are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function diffAssoc($items)
@@ -295,8 +355,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items whose keys and values are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function diffAssocUsing($items, callable $callback)
@@ -307,7 +367,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items whose keys are not present in the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function diffKeys($items)
@@ -318,8 +378,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items whose keys are not present in the given items, using the callback.
*
- * @param mixed $items
- * @param callable $callback
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function diffKeysUsing($items, callable $callback)
@@ -330,7 +390,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Retrieve duplicate items.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): bool)|string|null $callback
* @param bool $strict
* @return static
*/
@@ -342,7 +402,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Retrieve duplicate items using strict comparison.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): bool)|string|null $callback
* @return static
*/
public function duplicatesStrict($callback = null)
@@ -353,7 +413,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get all items except for those with the specified keys.
*
- * @param mixed $keys
+ * @param \Tightenco\Collect\Support\Enumerable<array-key, TKey>|array<array-key, TKey> $keys
* @return static
*/
public function except($keys)
@@ -364,15 +424,13 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Run a filter over each of the items.
*
- * @param callable|null $callback
+ * @param (callable(TValue, TKey): bool)|null $callback
* @return static
*/
public function filter(callable $callback = null)
{
if (is_null($callback)) {
- $callback = function ($value) {
- return (bool) $value;
- };
+ $callback = fn ($value) => (bool) $value;
}
return new static(function () use ($callback) {
@@ -387,9 +445,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the first item from the enumerable passing the given truth test.
*
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
+ * @template TFirstDefault
+ *
+ * @param (callable(TValue): bool)|null $callback
+ * @param TFirstDefault|(\Closure(): TFirstDefault) $default
+ * @return TValue|TFirstDefault
*/
public function first(callable $callback = null, $default = null)
{
@@ -416,7 +476,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* Get a flattened list of the items in the collection.
*
* @param int $depth
- * @return static
+ * @return static<int, mixed>
*/
public function flatten($depth = INF)
{
@@ -438,7 +498,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Flip the items in the collection.
*
- * @return static
+ * @return static<TValue, TKey>
*/
public function flip()
{
@@ -452,9 +512,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get an item by key.
*
- * @param mixed $key
- * @param mixed $default
- * @return mixed
+ * @template TGetDefault
+ *
+ * @param TKey|null $key
+ * @param TGetDefault|(\Closure(): TGetDefault) $default
+ * @return TValue|TGetDefault
*/
public function get($key, $default = null)
{
@@ -474,9 +536,9 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Group an associative array by a field or using a callback.
*
- * @param array|callable|string $groupBy
+ * @param (callable(TValue, TKey): array-key)|array|string $groupBy
* @param bool $preserveKeys
- * @return static
+ * @return static<array-key, static<array-key, TValue>>
*/
public function groupBy($groupBy, $preserveKeys = false)
{
@@ -486,8 +548,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Key an associative array by a field or using a callback.
*
- * @param callable|string $keyBy
- * @return static
+ * @param (callable(TValue, TKey): array-key)|array|string $keyBy
+ * @return static<array-key, TValue>
*/
public function keyBy($keyBy)
{
@@ -548,7 +610,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Concatenate values of a given key as a string.
*
- * @param string $value
+ * @param callable|string $value
* @param string|null $glue
* @return string
*/
@@ -560,7 +622,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Intersect the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function intersect($items)
@@ -568,10 +630,45 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
return $this->passthru('intersect', func_get_args());
}
+ /**
+ * Intersect the collection with the given items, using the callback.
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
+ * @return static
+ */
+ public function intersectUsing()
+ {
+ return $this->passthru('intersectUsing', func_get_args());
+ }
+
+ /**
+ * Intersect the collection with the given items with additional index check.
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
+ * @return static
+ */
+ public function intersectAssoc($items)
+ {
+ return $this->passthru('intersectAssoc', func_get_args());
+ }
+
+ /**
+ * Intersect the collection with the given items with additional index check, using the callback.
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue> $items
+ * @param callable(TValue, TValue): int $callback
+ * @return static
+ */
+ public function intersectAssocUsing($items, callable $callback)
+ {
+ return $this->passthru('intersectAssocUsing', func_get_args());
+ }
+
/**
* Intersect the collection with the given items by key.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function intersectByKeys($items)
@@ -614,7 +711,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the keys of the collection items.
*
- * @return static
+ * @return static<int, TKey>
*/
public function keys()
{
@@ -628,9 +725,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the last item from the collection.
*
- * @param callable|null $callback
- * @param mixed $default
- * @return mixed
+ * @template TLastDefault
+ *
+ * @param (callable(TValue, TKey): bool)|null $callback
+ * @param TLastDefault|(\Closure(): TLastDefault) $default
+ * @return TValue|TLastDefault
*/
public function last(callable $callback = null, $default = null)
{
@@ -648,9 +747,9 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the values of a given key.
*
- * @param string|array $value
+ * @param string|array<array-key, string> $value
* @param string|null $key
- * @return static
+ * @return static<int, mixed>
*/
public function pluck($value, $key = null)
{
@@ -678,8 +777,10 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Run a map over each of the items.
*
- * @param callable $callback
- * @return static
+ * @template TMapValue
+ *
+ * @param callable(TValue, TKey): TMapValue $callback
+ * @return static<TKey, TMapValue>
*/
public function map(callable $callback)
{
@@ -695,8 +796,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapToDictionaryKey of array-key
+ * @template TMapToDictionaryValue
+ *
+ * @param callable(TValue, TKey): array<TMapToDictionaryKey, TMapToDictionaryValue> $callback
+ * @return static<TMapToDictionaryKey, array<int, TMapToDictionaryValue>>
*/
public function mapToDictionary(callable $callback)
{
@@ -708,8 +812,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapWithKeysKey of array-key
+ * @template TMapWithKeysValue
+ *
+ * @param callable(TValue, TKey): array<TMapWithKeysKey, TMapWithKeysValue> $callback
+ * @return static<TMapWithKeysKey, TMapWithKeysValue>
*/
public function mapWithKeys(callable $callback)
{
@@ -723,7 +830,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Merge the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function merge($items)
@@ -734,8 +841,10 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Recursively merge the collection with the given items.
*
- * @param mixed $items
- * @return static
+ * @template TMergeRecursiveValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TMergeRecursiveValue>|iterable<TKey, TMergeRecursiveValue> $items
+ * @return static<TKey, TValue|TMergeRecursiveValue>
*/
public function mergeRecursive($items)
{
@@ -745,8 +854,10 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Create a collection by using this collection for keys and another for its values.
*
- * @param mixed $values
- * @return static
+ * @template TCombineValue
+ *
+ * @param \IteratorAggregate<array-key, TCombineValue>|array<array-key, TCombineValue>|(callable(): \Generator<array-key, TCombineValue>) $values
+ * @return static<TValue, TCombineValue>
*/
public function combine($values)
{
@@ -776,7 +887,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Union the collection with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function union($items)
@@ -796,8 +907,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
return new static(function () use ($step, $offset) {
$position = 0;
- foreach ($this as $item) {
- if ($position % $step === $offset) {
+ foreach ($this->slice($offset) as $item) {
+ if ($position % $step === 0) {
yield $item;
}
@@ -809,7 +920,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the items with the specified keys.
*
- * @param mixed $keys
+ * @param \Tightenco\Collect\Support\Enumerable<array-key, TKey>|array<array-key, TKey>|string $keys
* @return static
*/
public function only($keys)
@@ -844,7 +955,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Push all of the given items onto the collection.
*
- * @param iterable $source
+ * @param iterable<array-key, TValue> $source
* @return static
*/
public function concat($source)
@@ -859,7 +970,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* Get one or a specified number of items randomly from the collection.
*
* @param int|null $number
- * @return static|mixed
+ * @return static<int, TValue>|TValue
*
* @throws \InvalidArgumentException
*/
@@ -873,7 +984,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Replace the collection items with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function replace($items)
@@ -900,7 +1011,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Recursively replace the collection items with the given items.
*
- * @param mixed $items
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue> $items
* @return static
*/
public function replaceRecursive($items)
@@ -921,12 +1032,13 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Search the collection for a given value and return the corresponding key if successful.
*
- * @param mixed $value
+ * @param TValue|(callable(TValue,TKey): bool) $value
* @param bool $strict
- * @return mixed
+ * @return TKey|bool
*/
public function search($value, $strict = false)
{
+ /** @var (callable(TValue,TKey): bool) $predicate */
$predicate = $this->useAsCallable($value)
? $value
: function ($item) use ($value, $strict) {
@@ -958,7 +1070,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
*
* @param int $size
* @param int $step
- * @return static
+ * @return static<int, static>
*/
public function sliding($size = 2, $step = 1)
{
@@ -971,7 +1083,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
$chunk[$iterator->key()] = $iterator->current();
if (count($chunk) == $size) {
- yield tap(new static($chunk), function () use (&$chunk, $step) {
+ yield (new static($chunk))->tap(function () use (&$chunk, $step) {
$chunk = array_slice($chunk, $step, null, true);
});
@@ -1018,7 +1130,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Skip items in the collection until the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function skipUntil($value)
@@ -1031,7 +1143,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Skip items in the collection while the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function skipWhile($value)
@@ -1075,7 +1187,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* Split a collection into a certain number of groups.
*
* @param int $numberOfGroups
- * @return static
+ * @return static<int, static>
*/
public function split($numberOfGroups)
{
@@ -1085,10 +1197,10 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|string $key
* @param mixed $operator
* @param mixed $value
- * @return mixed
+ * @return TValue
*
* @throws \Tightenco\Collect\Support\ItemNotFoundException
* @throws \Tightenco\Collect\Support\MultipleItemsFoundException
@@ -1100,7 +1212,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
: $key;
return $this
- ->when($filter)
+ ->unless($filter == null)
->filter($filter)
->take(2)
->collect()
@@ -1110,10 +1222,10 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the first item in the collection but throw an exception if no matching items exist.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|string $key
* @param mixed $operator
* @param mixed $value
- * @return mixed
+ * @return TValue
*
* @throws \Tightenco\Collect\Support\ItemNotFoundException
*/
@@ -1124,7 +1236,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
: $key;
return $this
- ->when($filter)
+ ->unless($filter == null)
->filter($filter)
->take(1)
->collect()
@@ -1135,7 +1247,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* Chunk the collection into chunks of the given size.
*
* @param int $size
- * @return static
+ * @return static<int, static>
*/
public function chunk($size)
{
@@ -1174,7 +1286,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* Split a collection into a certain number of groups, and fill the first groups completely.
*
* @param int $numberOfGroups
- * @return static
+ * @return static<int, static>
*/
public function splitIn($numberOfGroups)
{
@@ -1184,8 +1296,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Chunk the collection into chunks with a callback.
*
- * @param callable $callback
- * @return static
+ * @param callable(TValue, TKey, Collection<TKey, TValue>): bool $callback
+ * @return static<int, static<int, TValue>>
*/
public function chunkWhile(callable $callback)
{
@@ -1221,7 +1333,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Sort through each item with a callback.
*
- * @param callable|null|int $callback
+ * @param (callable(TValue, TValue): int)|null|int $callback
* @return static
*/
public function sort($callback = null)
@@ -1243,7 +1355,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Sort the collection using the given callback.
*
- * @param callable|string $callback
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}>|(callable(TValue, TKey): mixed)|string $callback
* @param int $options
* @param bool $descending
* @return static
@@ -1256,7 +1368,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Sort the collection in descending order using the given callback.
*
- * @param callable|string $callback
+ * @param array<array-key, (callable(TValue, TValue): mixed)|(callable(TValue, TKey): mixed)|string|array{string, string}>|(callable(TValue, TKey): mixed)|string $callback
* @param int $options
* @return static
*/
@@ -1291,7 +1403,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Sort the collection keys using a callback.
*
- * @param callable $callback
+ * @param callable(TKey, TKey): int $callback
* @return static
*/
public function sortKeysUsing(callable $callback)
@@ -1331,11 +1443,12 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Take items in the collection until the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function takeUntil($value)
{
+ /** @var callable(TValue, TKey): bool $callback */
$callback = $this->useAsCallable($value) ? $value : $this->equality($value);
return new static(function () use ($callback) {
@@ -1359,30 +1472,39 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
{
$timeout = $timeout->getTimestamp();
- return $this->takeWhile(function () use ($timeout) {
- return $this->now() < $timeout;
+ return new static(function () use ($timeout) {
+ if ($this->now() >= $timeout) {
+ return;
+ }
+
+ foreach ($this as $key => $value) {
+ yield $key => $value;
+
+ if ($this->now() >= $timeout) {
+ break;
+ }
+ }
});
}
/**
* Take items in the collection while the given condition is met.
*
- * @param mixed $value
+ * @param TValue|callable(TValue,TKey): bool $value
* @return static
*/
public function takeWhile($value)
{
+ /** @var callable(TValue, TKey): bool $callback */
$callback = $this->useAsCallable($value) ? $value : $this->equality($value);
- return $this->takeUntil(function ($item, $key) use ($callback) {
- return ! $callback($item, $key);
- });
+ return $this->takeUntil(fn ($item, $key) => ! $callback($item, $key));
}
/**
* Pass each item in the collection to the given callback, lazily.
*
- * @param callable $callback
+ * @param callable(TValue, TKey): mixed $callback
* @return static
*/
public function tapEach(callable $callback)
@@ -1409,7 +1531,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Return only unique items from the collection array.
*
- * @param string|callable|null $key
+ * @param (callable(TValue, TKey): mixed)|string|null $key
* @param bool $strict
* @return static
*/
@@ -1433,7 +1555,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Reset the keys on the underlying array.
*
- * @return static
+ * @return static<int, TValue>
*/
public function values()
{
@@ -1450,8 +1572,10 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]);
* => [[1, 4], [2, 5], [3, 6]]
*
- * @param mixed ...$items
- * @return static
+ * @template TZipValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue> ...$items
+ * @return static<int, static<int, TValue|TZipValue>>
*/
public function zip($items)
{
@@ -1473,9 +1597,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Pad collection to the specified length with a value.
*
+ * @template TPadValue
+ *
* @param int $size
- * @param mixed $value
- * @return static
+ * @param TPadValue $value
+ * @return static<int, TValue|TPadValue>
*/
public function pad($size, $value)
{
@@ -1501,10 +1627,9 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Get the values iterator.
*
- * @return \Traversable
+ * @return \Traversable<TKey, TValue>
*/
- #[\ReturnTypeWillChange]
- public function getIterator()
+ public function getIterator(): Traversable
{
return $this->makeIterator($this->source);
}
@@ -1514,8 +1639,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
*
* @return int
*/
- #[\ReturnTypeWillChange]
- public function count()
+ public function count(): int
{
if (is_array($this->source)) {
return count($this->source);
@@ -1527,8 +1651,11 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
/**
* Make an iterator from the given source.
*
- * @param mixed $source
- * @return \Traversable
+ * @template TIteratorKey of array-key
+ * @template TIteratorValue
+ *
+ * @param \IteratorAggregate<TIteratorKey, TIteratorValue>|array<TIteratorKey, TIteratorValue>|(callable(): \Generator<TIteratorKey, TIteratorValue>) $source
+ * @return \Traversable<TIteratorKey, TIteratorValue>
*/
protected function makeIterator($source)
{
@@ -1540,15 +1667,23 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
return new ArrayIterator($source);
}
- return $source();
+ if (is_callable($source)) {
+ $maybeTraversable = $source();
+
+ return $maybeTraversable instanceof Traversable
+ ? $maybeTraversable
+ : new ArrayIterator(Arr::wrap($maybeTraversable));
+ }
+
+ return new ArrayIterator((array) $source);
}
/**
* Explode the "value" and "key" arguments passed to "pluck".
*
- * @param string|array $value
- * @param string|array|null $key
- * @return array
+ * @param string|string[] $value
+ * @param string|string[]|null $key
+ * @return array{string[],string[]|null}
*/
protected function explodePluckParameters($value, $key)
{
@@ -1563,7 +1698,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
* Pass this lazy collection through a method on the collection class.
*
* @param string $method
- * @param array $params
+ * @param array<mixed> $params
* @return static
*/
protected function passthru($method, array $params)
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Str.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Str.php
new file mode 100644
index 00000000..07e82545
--- /dev/null
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Str.php
@@ -0,0 +1,1367 @@
+<?php
+
+namespace Tightenco\Collect\Support;
+
+use Closure;
+use Tightenco\Collect\Support\Traits\Macroable;
+use JsonException;
+use League\CommonMark\Environment\Environment;
+use League\CommonMark\Extension\GithubFlavoredMarkdownExtension;
+use League\CommonMark\Extension\InlinesOnly\InlinesOnlyExtension;
+use League\CommonMark\GithubFlavoredMarkdownConverter;
+use League\CommonMark\MarkdownConverter;
+use Ramsey\Uuid\Codec\TimestampFirstCombCodec;
+use Ramsey\Uuid\Generator\CombGenerator;
+use Ramsey\Uuid\Uuid;
+use Ramsey\Uuid\UuidFactory;
+use Symfony\Component\Uid\Ulid;
+use Traversable;
+use voku\helper\ASCII;
+
+class Str
+{
+ use Macroable;
+
+ /**
+ * The cache of snake-cased words.
+ *
+ * @var array
+ */
+ protected static $snakeCache = [];
+
+ /**
+ * The cache of camel-cased words.
+ *
+ * @var array
+ */
+ protected static $camelCache = [];
+
+ /**
+ * The cache of studly-cased words.
+ *
+ * @var array
+ */
+ protected static $studlyCache = [];
+
+ /**
+ * The callback that should be used to generate UUIDs.
+ *
+ * @var callable|null
+ */
+ protected static $uuidFactory;
+
+ /**
+ * The callback that should be used to generate random strings.
+ *
+ * @var callable|null
+ */
+ protected static $randomStringFactory;
+
+ /**
+ * Get a new stringable object from the given string.
+ *
+ * @param string $string
+ * @return \Tightenco\Collect\Support\Stringable
+ */
+ public static function of($string)
+ {
+ return new Stringable($string);
+ }
+
+ /**
+ * Return the remainder of a string after the first occurrence of a given value.
+ *
+ * @param string $subject
+ * @param string $search
+ * @return string
+ */
+ public static function after($subject, $search)
+ {
+ return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0];
+ }
+
+ /**
+ * Return the remainder of a string after the last occurrence of a given value.
+ *
+ * @param string $subject
+ * @param string $search
+ * @return string
+ */
+ public static function afterLast($subject, $search)
+ {
+ if ($search === '') {
+ return $subject;
+ }
+
+ $position = strrpos($subject, (string) $search);
+
+ if ($position === false) {
+ return $subject;
+ }
+
+ return substr($subject, $position + strlen($search));
+ }
+
+ /**
+ * Transliterate a UTF-8 value to ASCII.
+ *
+ * @param string $value
+ * @param string $language
+ * @return string
+ */
+ public static function ascii($value, $language = 'en')
+ {
+ return ASCII::to_ascii((string) $value, $language);
+ }
+
+ /**
+ * Transliterate a string to its closest ASCII representation.
+ *
+ * @param string $string
+ * @param string|null $unknown
+ * @param bool|null $strict
+ * @return string
+ */
+ public static function transliterate($string, $unknown = '?', $strict = false)
+ {
+ return ASCII::to_transliterate($string, $unknown, $strict);
+ }
+
+ /**
+ * Get the portion of a string before the first occurrence of a given value.
+ *
+ * @param string $subject
+ * @param string $search
+ * @return string
+ */
+ public static function before($subject, $search)
+ {
+ if ($search === '') {
+ return $subject;
+ }
+
+ $result = strstr($subject, (string) $search, true);
+
+ return $result === false ? $subject : $result;
+ }
+
+ /**
+ * Get the portion of a string before the last occurrence of a given value.
+ *
+ * @param string $subject
+ * @param string $search
+ * @return string
+ */
+ public static function beforeLast($subject, $search)
+ {
+ if ($search === '') {
+ return $subject;
+ }
+
+ $pos = mb_strrpos($subject, $search);
+
+ if ($pos === false) {
+ return $subject;
+ }
+
+ return static::substr($subject, 0, $pos);
+ }
+
+ /**
+ * Get the portion of a string between two given values.
+ *
+ * @param string $subject
+ * @param string $from
+ * @param string $to
+ * @return string
+ */
+ public static function between($subject, $from, $to)
+ {
+ if ($from === '' || $to === '') {
+ return $subject;
+ }
+
+ return static::beforeLast(static::after($subject, $from), $to);
+ }
+
+ /**
+ * Get the smallest possible portion of a string between two given values.
+ *
+ * @param string $subject
+ * @param string $from
+ * @param string $to
+ * @return string
+ */
+ public static function betweenFirst($subject, $from, $to)
+ {
+ if ($from === '' || $to === '') {
+ return $subject;
+ }
+
+ return static::before(static::after($subject, $from), $to);
+ }
+
+ /**
+ * Convert a value to camel case.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function camel($value)
+ {
+ if (isset(static::$camelCache[$value])) {
+ return static::$camelCache[$value];
+ }
+
+ return static::$camelCache[$value] = lcfirst(static::studly($value));
+ }
+
+ /**
+ * Determine if a given string contains a given substring.
+ *
+ * @param string $haystack
+ * @param string|iterable<string> $needles
+ * @param bool $ignoreCase
+ * @return bool
+ */
+ public static function contains($haystack, $needles, $ignoreCase = false)
+ {
+ if ($ignoreCase) {
+ $haystack = mb_strtolower($haystack);
+ }
+
+ if (! is_iterable($needles)) {
+ $needles = (array) $needles;
+ }
+
+ foreach ($needles as $needle) {
+ if ($ignoreCase) {
+ $needle = mb_strtolower($needle);
+ }
+
+ if ($needle !== '' && str_contains($haystack, $needle)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determine if a given string contains all array values.
+ *
+ * @param string $haystack
+ * @param iterable<string> $needles
+ * @param bool $ignoreCase
+ * @return bool
+ */
+ public static function containsAll($haystack, $needles, $ignoreCase = false)
+ {
+ foreach ($needles as $needle) {
+ if (! static::contains($haystack, $needle, $ignoreCase)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Determine if a given string ends with a given substring.
+ *
+ * @param string $haystack
+ * @param string|iterable<string> $needles
+ * @return bool
+ */
+ public static function endsWith($haystack, $needles)
+ {
+ if (! is_iterable($needles)) {
+ $needles = (array) $needles;
+ }
+
+ foreach ($needles as $needle) {
+ if ((string) $needle !== '' && str_ends_with($haystack, $needle)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Extracts an excerpt from text that matches the first instance of a phrase.
+ *
+ * @param string $text
+ * @param string $phrase
+ * @param array $options
+ * @return string|null
+ */
+ public static function excerpt($text, $phrase = '', $options = [])
+ {
+ $radius = $options['radius'] ?? 100;
+ $omission = $options['omission'] ?? '...';
+
+ preg_match('/^(.*?)('.preg_quote((string) $phrase).')(.*)$/iu', (string) $text, $matches);
+
+ if (empty($matches)) {
+ return null;
+ }
+
+ $start = ltrim($matches[1]);
+
+ $start = str(mb_substr($start, max(mb_strlen($start, 'UTF-8') - $radius, 0), $radius, 'UTF-8'))->ltrim()->unless(
+ fn ($startWithRadius) => $startWithRadius->exactly($start),
+ fn ($startWithRadius) => $startWithRadius->prepend($omission),
+ );
+
+ $end = rtrim($matches[3]);
+
+ $end = str(mb_substr($end, 0, $radius, 'UTF-8'))->rtrim()->unless(
+ fn ($endWithRadius) => $endWithRadius->exactly($end),
+ fn ($endWithRadius) => $endWithRadius->append($omission),
+ );
+
+ return $start->append($matches[2], $end)->toString();
+ }
+
+ /**
+ * Cap a string with a single instance of a given value.
+ *
+ * @param string $value
+ * @param string $cap
+ * @return string
+ */
+ public static function finish($value, $cap)
+ {
+ $quoted = preg_quote($cap, '/');
+
+ return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap;
+ }
+
+ /**
+ * Wrap the string with the given strings.
+ *
+ * @param string $value
+ * @param string $before
+ * @param string|null $after
+ * @return string
+ */
+ public static function wrap($value, $before, $after = null)
+ {
+ return $before.$value.($after ??= $before);
+ }
+
+ /**
+ * Determine if a given string matches a given pattern.
+ *
+ * @param string|iterable<string> $pattern
+ * @param string $value
+ * @return bool
+ */
+ public static function is($pattern, $value)
+ {
+ $value = (string) $value;
+
+ if (! is_iterable($pattern)) {
+ $pattern = [$pattern];
+ }
+
+ foreach ($pattern as $pattern) {
+ $pattern = (string) $pattern;
+
+ // If the given value is an exact match we can of course return true right
+ // from the beginning. Otherwise, we will translate asterisks and do an
+ // actual pattern match against the two strings to see if they match.
+ if ($pattern === $value) {
+ return true;
+ }
+
+ $pattern = preg_quote($pattern, '#');
+
+ // Asterisks are translated into zero-or-more regular expression wildcards
+ // to make it convenient to check if the strings starts with the given
+ // pattern such as "library/*", making any string check convenient.
+ $pattern = str_replace('\*', '.*', $pattern);
+
+ if (preg_match('#^'.$pattern.'\z#u', $value) === 1) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determine if a given string is 7 bit ASCII.
+ *
+ * @param string $value
+ * @return bool
+ */
+ public static function isAscii($value)
+ {
+ return ASCII::is_ascii((string) $value);
+ }
+
+ /**
+ * Determine if a given string is valid JSON.
+ *
+ * @param string $value
+ * @return bool
+ */
+ public static function isJson($value)
+ {
+ if (! is_string($value)) {
+ return false;
+ }
+
+ try {
+ json_decode($value, true, 512, JSON_THROW_ON_ERROR);
+ } catch (JsonException) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Determine if a given string is a valid UUID.
+ *
+ * @param string $value
+ * @return bool
+ */
+ public static function isUuid($value)
+ {
+ if (! is_string($value)) {
+ return false;
+ }
+
+ return preg_match('/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iD', $value) > 0;
+ }
+
+ /**
+ * Determine if a given string is a valid ULID.
+ *
+ * @param string $value
+ * @return bool
+ */
+ public static function isUlid($value)
+ {
+ if (! is_string($value)) {
+ return false;
+ }
+
+ return Ulid::isValid($value);
+ }
+
+ /**
+ * Convert a string to kebab case.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function kebab($value)
+ {
+ return static::snake($value, '-');
+ }
+
+ /**
+ * Return the length of the given string.
+ *
+ * @param string $value
+ * @param string|null $encoding
+ * @return int
+ */
+ public static function length($value, $encoding = null)
+ {
+ if ($encoding) {
+ return mb_strlen($value, $encoding);
+ }
+
+ return mb_strlen($value);
+ }
+
+ /**
+ * Limit the number of characters in a string.
+ *
+ * @param string $value
+ * @param int $limit
+ * @param string $end
+ * @return string
+ */
+ public static function limit($value, $limit = 100, $end = '...')
+ {
+ if (mb_strwidth($value, 'UTF-8') <= $limit) {
+ return $value;
+ }
+
+ return rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')).$end;
+ }
+
+ /**
+ * Convert the given string to lower-case.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function lower($value)
+ {
+ return mb_strtolower($value, 'UTF-8');
+ }
+
+ /**
+ * Limit the number of words in a string.
+ *
+ * @param string $value
+ * @param int $words
+ * @param string $end
+ * @return string
+ */
+ public static function words($value, $words = 100, $end = '...')
+ {
+ preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches);
+
+ if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) {
+ return $value;
+ }
+
+ return rtrim($matches[0]).$end;
+ }
+
+ /**
+ * Converts GitHub flavored Markdown into HTML.
+ *
+ * @param string $string
+ * @param array $options
+ * @return string
+ */
+ public static function markdown($string, array $options = [])
+ {
+ $converter = new GithubFlavoredMarkdownConverter($options);
+
+ return (string) $converter->convert($string);
+ }
+
+ /**
+ * Converts inline Markdown into HTML.
+ *
+ * @param string $string
+ * @param array $options
+ * @return string
+ */
+ public static function inlineMarkdown($string, array $options = [])
+ {
+ $environment = new Environment($options);
+
+ $environment->addExtension(new GithubFlavoredMarkdownExtension());
+ $environment->addExtension(new InlinesOnlyExtension());
+
+ $converter = new MarkdownConverter($environment);
+
+ return (string) $converter->convert($string);
+ }
+
+ /**
+ * Masks a portion of a string with a repeated character.
+ *
+ * @param string $string
+ * @param string $character
+ * @param int $index
+ * @param int|null $length
+ * @param string $encoding
+ * @return string
+ */
+ public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8')
+ {
+ if ($character === '') {
+ return $string;
+ }
+
+ $segment = mb_substr($string, $index, $length, $encoding);
+
+ if ($segment === '') {
+ return $string;
+ }
+
+ $strlen = mb_strlen($string, $encoding);
+ $startIndex = $index;
+
+ if ($index < 0) {
+ $startIndex = $index < -$strlen ? 0 : $strlen + $index;
+ }
+
+ $start = mb_substr($string, 0, $startIndex, $encoding);
+ $segmentLen = mb_strlen($segment, $encoding);
+ $end = mb_substr($string, $startIndex + $segmentLen);
+
+ return $start.str_repeat(mb_substr($character, 0, 1, $encoding), $segmentLen).$end;
+ }
+
+ /**
+ * Get the string matching the given pattern.
+ *
+ * @param string $pattern
+ * @param string $subject
+ * @return string
+ */
+ public static function match($pattern, $subject)
+ {
+ preg_match($pattern, $subject, $matches);
+
+ if (! $matches) {
+ return '';
+ }
+
+ return $matches[1] ?? $matches[0];
+ }
+
+ /**
+ * Get the string matching the given pattern.
+ *
+ * @param string $pattern
+ * @param string $subject
+ * @return \Tightenco\Collect\Support\Collection
+ */
+ public static function matchAll($pattern, $subject)
+ {
+ preg_match_all($pattern, $subject, $matches);
+
+ if (empty($matches[0])) {
+ return collect();
+ }
+
+ return collect($matches[1] ?? $matches[0]);
+ }
+
+ /**
+ * Pad both sides of a string with another.
+ *
+ * @param string $value
+ * @param int $length
+ * @param string $pad
+ * @return string
+ */
+ public static function padBoth($value, $length, $pad = ' ')
+ {
+ $short = max(0, $length - mb_strlen($value));
+ $shortLeft = floor($short / 2);
+ $shortRight = ceil($short / 2);
+
+ return mb_substr(str_repeat($pad, $shortLeft), 0, $shortLeft).
+ $value.
+ mb_substr(str_repeat($pad, $shortRight), 0, $shortRight);
+ }
+
+ /**
+ * Pad the left side of a string with another.
+ *
+ * @param string $value
+ * @param int $length
+ * @param string $pad
+ * @return string
+ */
+ public static function padLeft($value, $length, $pad = ' ')
+ {
+ $short = max(0, $length - mb_strlen($value));
+
+ return mb_substr(str_repeat($pad, $short), 0, $short).$value;
+ }
+
+ /**
+ * Pad the right side of a string with another.
+ *
+ * @param string $value
+ * @param int $length
+ * @param string $pad
+ * @return string
+ */
+ public static function padRight($value, $length, $pad = ' ')
+ {
+ $short = max(0, $length - mb_strlen($value));
+
+ return $value.mb_substr(str_repeat($pad, $short), 0, $short);
+ }
+
+ /**
+ * Parse a Class[@]method style callback into class and method.
+ *
+ * @param string $callback
+ * @param string|null $default
+ * @return array<int, string|null>
+ */
+ public static function parseCallback($callback, $default = null)
+ {
+ return static::contains($callback, '@') ? explode('@', $callback, 2) : [$callback, $default];
+ }
+
+ /**
+ * Get the plural form of an English word.
+ *
+ * @param string $value
+ * @param int|array|\Countable $count
+ * @return string
+ */
+ public static function plural($value, $count = 2)
+ {
+ return Pluralizer::plural($value, $count);
+ }
+
+ /**
+ * Pluralize the last word of an English, studly caps case string.
+ *
+ * @param string $value
+ * @param int|array|\Countable $count
+ * @return string
+ */
+ public static function pluralStudly($value, $count = 2)
+ {
+ $parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
+
+ $lastWord = array_pop($parts);
+
+ return implode('', $parts).self::plural($lastWord, $count);
+ }
+
+ /**
+ * Generate a more truly "random" alpha-numeric string.
+ *
+ * @param int $length
+ * @return string
+ */
+ public static function random($length = 16)
+ {
+ return (static::$randomStringFactory ?? function ($length) {
+ $string = '';
+
+ while (($len = strlen($string)) < $length) {
+ $size = $length - $len;
+
+ $bytesSize = (int) ceil($size / 3) * 3;
+
+ $bytes = random_bytes($bytesSize);
+
+ $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);
+ }
+
+ return $string;
+ })($length);
+ }
+
+ /**
+ * Set the callable that will be used to generate random strings.
+ *
+ * @param callable|null $factory
+ * @return void
+ */
+ public static function createRandomStringsUsing(callable $factory = null)
+ {
+ static::$randomStringFactory = $factory;
+ }
+
+ /**
+ * Set the sequence that will be used to generate random strings.
+ *
+ * @param array $sequence
+ * @param callable|null $whenMissing
+ * @return void
+ */
+ public static function createRandomStringsUsingSequence(array $sequence, $whenMissing = null)
+ {
+ $next = 0;
+
+ $whenMissing ??= function ($length) use (&$next) {
+ $factoryCache = static::$randomStringFactory;
+
+ static::$randomStringFactory = null;
+
+ $randomString = static::random($length);
+
+ static::$randomStringFactory = $factoryCache;
+
+ $next++;
+
+ return $randomString;
+ };
+
+ static::createRandomStringsUsing(function ($length) use (&$next, $sequence, $whenMissing) {
+ if (array_key_exists($next, $sequence)) {
+ return $sequence[$next++];
+ }
+
+ return $whenMissing($length);
+ });
+ }
+
+ /**
+ * Indicate that random strings should be created normally and not using a custom factory.
+ *
+ * @return void
+ */
+ public static function createRandomStringsNormally()
+ {
+ static::$randomStringFactory = null;
+ }
+
+ /**
+ * Repeat the given string.
+ *
+ * @param string $string
+ * @param int $times
+ * @return string
+ */
+ public static function repeat(string $string, int $times)
+ {
+ return str_repeat($string, $times);
+ }
+
+ /**
+ * Replace a given value in the string sequentially with an array.
+ *
+ * @param string $search
+ * @param iterable<string> $replace
+ * @param string $subject
+ * @return string
+ */
+ public static function replaceArray($search, $replace, $subject)
+ {
+ if ($replace instanceof Traversable) {
+ $replace = collect($replace)->all();
+ }
+
+ $segments = explode($search, $subject);
+
+ $result = array_shift($segments);
+
+ foreach ($segments as $segment) {
+ $result .= (array_shift($replace) ?? $search).$segment;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Replace the given value in the given string.
+ *
+ * @param string|iterable<string> $search
+ * @param string|iterable<string> $replace
+ * @param string|iterable<string> $subject
+ * @return string
+ */
+ public static function replace($search, $replace, $subject)
+ {
+ if ($search instanceof Traversable) {
+ $search = collect($search)->all();
+ }
+
+ if ($replace instanceof Traversable) {
+ $replace = collect($replace)->all();
+ }
+
+ if ($subject instanceof Traversable) {
+ $subject = collect($subject)->all();
+ }
+
+ return str_replace($search, $replace, $subject);
+ }
+
+ /**
+ * Replace the first occurrence of a given value in the string.
+ *
+ * @param string $search
+ * @param string $replace
+ * @param string $subject
+ * @return string
+ */
+ public static function replaceFirst($search, $replace, $subject)
+ {
+ $search = (string) $search;
+
+ if ($search === '') {
+ return $subject;
+ }
+
+ $position = strpos($subject, $search);
+
+ if ($position !== false) {
+ return substr_replace($subject, $replace, $position, strlen($search));
+ }
+
+ return $subject;
+ }
+
+ /**
+ * Replace the last occurrence of a given value in the string.
+ *
+ * @param string $search
+ * @param string $replace
+ * @param string $subject
+ * @return string
+ */
+ public static function replaceLast($search, $replace, $subject)
+ {
+ if ($search === '') {
+ return $subject;
+ }
+
+ $position = strrpos($subject, $search);
+
+ if ($position !== false) {
+ return substr_replace($subject, $replace, $position, strlen($search));
+ }
+
+ return $subject;
+ }
+
+ /**
+ * Remove any occurrence of the given string in the subject.
+ *
+ * @param string|iterable<string> $search
+ * @param string $subject
+ * @param bool $caseSensitive
+ * @return string
+ */
+ public static function remove($search, $subject, $caseSensitive = true)
+ {
+ if ($search instanceof Traversable) {
+ $search = collect($search)->all();
+ }
+
+ $subject = $caseSensitive
+ ? str_replace($search, '', $subject)
+ : str_ireplace($search, '', $subject);
+
+ return $subject;
+ }
+
+ /**
+ * Reverse the given string.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function reverse(string $value)
+ {
+ return implode(array_reverse(mb_str_split($value)));
+ }
+
+ /**
+ * Begin a string with a single instance of a given value.
+ *
+ * @param string $value
+ * @param string $prefix
+ * @return string
+ */
+ public static function start($value, $prefix)
+ {
+ $quoted = preg_quote($prefix, '/');
+
+ return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $value);
+ }
+
+ /**
+ * Convert the given string to upper-case.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function upper($value)
+ {
+ return mb_strtoupper($value, 'UTF-8');
+ }
+
+ /**
+ * Convert the given string to title case.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function title($value)
+ {
+ return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8');
+ }
+
+ /**
+ * Convert the given string to title case for each word.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function headline($value)
+ {
+ $parts = explode(' ', $value);
+
+ $parts = count($parts) > 1
+ ? array_map([static::class, 'title'], $parts)
+ : array_map([static::class, 'title'], static::ucsplit(implode('_', $parts)));
+
+ $collapsed = static::replace(['-', '_', ' '], '_', implode('_', $parts));
+
+ return implode(' ', array_filter(explode('_', $collapsed)));
+ }
+
+ /**
+ * Get the singular form of an English word.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function singular($value)
+ {
+ return Pluralizer::singular($value);
+ }
+
+ /**
+ * Generate a URL friendly "slug" from a given string.
+ *
+ * @param string $title
+ * @param string $separator
+ * @param string|null $language
+ * @param array<string, string> $dictionary
+ * @return string
+ */
+ public static function slug($title, $separator = '-', $language = 'en', $dictionary = ['@' => 'at'])
+ {
+ $title = $language ? static::ascii($title, $language) : $title;
+
+ // Convert all dashes/underscores into separator
+ $flip = $separator === '-' ? '_' : '-';
+
+ $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);
+
+ // Replace dictionary words
+ foreach ($dictionary as $key => $value) {
+ $dictionary[$key] = $separator.$value.$separator;
+ }
+
+ $title = str_replace(array_keys($dictionary), array_values($dictionary), $title);
+
+ // Remove all characters that are not the separator, letters, numbers, or whitespace
+ $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', static::lower($title));
+
+ // Replace all separator characters and whitespace by a single separator
+ $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title);
+
+ return trim($title, $separator);
+ }
+
+ /**
+ * Convert a string to snake case.
+ *
+ * @param string $value
+ * @param string $delimiter
+ * @return string
+ */
+ public static function snake($value, $delimiter = '_')
+ {
+ $key = $value;
+
+ if (isset(static::$snakeCache[$key][$delimiter])) {
+ return static::$snakeCache[$key][$delimiter];
+ }
+
+ if (! ctype_lower($value)) {
+ $value = preg_replace('/\s+/u', '', ucwords($value));
+
+ $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
+ }
+
+ return static::$snakeCache[$key][$delimiter] = $value;
+ }
+
+ /**
+ * Remove all "extra" blank space from the given string.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function squish($value)
+ {
+ return preg_replace('~(\s|\x{3164})+~u', ' ', preg_replace('~^[\s\x{FEFF}]+|[\s\x{FEFF}]+$~u', '', $value));
+ }
+
+ /**
+ * Determine if a given string starts with a given substring.
+ *
+ * @param string $haystack
+ * @param string|iterable<string> $needles
+ * @return bool
+ */
+ public static function startsWith($haystack, $needles)
+ {
+ if (! is_iterable($needles)) {
+ $needles = [$needles];
+ }
+
+ foreach ($needles as $needle) {
+ if ((string) $needle !== '' && str_starts_with($haystack, $needle)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert a value to studly caps case.
+ *
+ * @param string $value
+ * @return string
+ */
+ public static function studly($value)
+ {
+ $key = $value;
+
+ if (isset(static::$studlyCache[$key])) {
+ return static::$studlyCache[$key];
+ }
+
+ $words = explode(' ', static::replace(['-', '_'], ' ', $value));
+
+ $studlyWords = array_map(fn ($word) => static::ucfirst($word), $words);
+
+ return static::$studlyCache[$key] = implode($studlyWords);
+ }
+
+ /**
+ * Returns the portion of the string specified by the start and length parameters.
+ *
+ * @param string $string
+ * @param int $start
+ * @param int|null $length
+ * @param string $encoding
+ * @return string
+ */
+ public static function substr($string, $start, $length = null, $encoding = 'UTF-8')
+ {
+ return mb_substr($string, $start, $length, $encoding);
+ }
+
+ /**
+ * Returns the number of substring occurrences.
+ *
+ * @param string $haystack
+ * @param string $needle
+ * @param int $offset
+ * @param int|null $length
+ * @return int
+ */
+ public static function substrCount($haystack, $needle, $offset = 0, $length = null)
+ {
+ if (! is_null($length)) {
+ return substr_count($haystack, $needle, $offset, $length);
+ }
+
+ return substr_count($haystack, $needle, $offset);
+ }
+
+ /**
+ * Replace text within a portion of a string.
+ *
+ * @param string|string[] $string
+ * @param string|string[] $replace
+ * @param int|int[] $offset
+ * @param int|int[]|null $length
+ * @return string|string[]
+ */
+ public static function substrReplace($string, $replace, $offset = 0, $length = null)
+ {
+ if ($length === null) {
+ $length = strlen($string);
+ }
+
+ return substr_replace($string, $replace, $offset, $length);
+ }
+
+ /**
+ * Swap multiple keywords in a string with other keywords.
+ *
+ * @param array $map
+ * @param string $subject
+ * @return string
+ */
+ public static function swap(array $map, $subject)
+ {
+ return strtr($subject, $map);
+ }
+
+ /**
+ * Make a string's first character lowercase.
+ *
+ * @param string $string
+ * @return string
+ */
+ public static function lcfirst($string)
+ {
+ return static::lower(static::substr($string, 0, 1)).static::substr($string, 1);
+ }
+
+ /**
+ * Make a string's first character uppercase.
+ *
+ * @param string $string
+ * @return string
+ */
+ public static function ucfirst($string)
+ {
+ return static::upper(static::substr($string, 0, 1)).static::substr($string, 1);
+ }
+
+ /**
+ * Split a string into pieces by uppercase characters.
+ *
+ * @param string $string
+ * @return string[]
+ */
+ public static function ucsplit($string)
+ {
+ return preg_split('/(?=\p{Lu})/u', $string, -1, PREG_SPLIT_NO_EMPTY);
+ }
+
+ /**
+ * Get the number of words a string contains.
+ *
+ * @param string $string
+ * @param string|null $characters
+ * @return int
+ */
+ public static function wordCount($string, $characters = null)
+ {
+ return str_word_count($string, 0, $characters);
+ }
+
+ /**
+ * Generate a UUID (version 4).
+ *
+ * @return \Ramsey\Uuid\UuidInterface
+ */
+ public static function uuid()
+ {
+ return static::$uuidFactory
+ ? call_user_func(static::$uuidFactory)
+ : Uuid::uuid4();
+ }
+
+ /**
+ * Generate a time-ordered UUID (version 4).
+ *
+ * @return \Ramsey\Uuid\UuidInterface
+ */
+ public static function orderedUuid()
+ {
+ if (static::$uuidFactory) {
+ return call_user_func(static::$uuidFactory);
+ }
+
+ $factory = new UuidFactory;
+
+ $factory->setRandomGenerator(new CombGenerator(
+ $factory->getRandomGenerator(),
+ $factory->getNumberConverter()
+ ));
+
+ $factory->setCodec(new TimestampFirstCombCodec(
+ $factory->getUuidBuilder()
+ ));
+
+ return $factory->uuid4();
+ }
+
+ /**
+ * Set the callable that will be used to generate UUIDs.
+ *
+ * @param callable|null $factory
+ * @return void
+ */
+ public static function createUuidsUsing(callable $factory = null)
+ {
+ static::$uuidFactory = $factory;
+ }
+
+ /**
+ * Set the sequence that will be used to generate UUIDs.
+ *
+ * @param array $sequence
+ * @param callable|null $whenMissing
+ * @return void
+ */
+ public static function createUuidsUsingSequence(array $sequence, $whenMissing = null)
+ {
+ $next = 0;
+
+ $whenMissing ??= function () use (&$next) {
+ $factoryCache = static::$uuidFactory;
+
+ static::$uuidFactory = null;
+
+ $uuid = static::uuid();
+
+ static::$uuidFactory = $factoryCache;
+
+ $next++;
+
+ return $uuid;
+ };
+
+ static::createUuidsUsing(function () use (&$next, $sequence, $whenMissing) {
+ if (array_key_exists($next, $sequence)) {
+ return $sequence[$next++];
+ }
+
+ return $whenMissing();
+ });
+ }
+
+ /**
+ * Always return the same UUID when generating new UUIDs.
+ *
+ * @param \Closure|null $callback
+ * @return \Ramsey\Uuid\UuidInterface
+ */
+ public static function freezeUuids(Closure $callback = null)
+ {
+ $uuid = Str::uuid();
+
+ Str::createUuidsUsing(fn () => $uuid);
+
+ if ($callback !== null) {
+ try {
+ $callback($uuid);
+ } finally {
+ Str::createUuidsNormally();
+ }
+ }
+
+ return $uuid;
+ }
+
+ /**
+ * Indicate that UUIDs should be created normally and not using a custom factory.
+ *
+ * @return void
+ */
+ public static function createUuidsNormally()
+ {
+ static::$uuidFactory = null;
+ }
+
+ /**
+ * Generate a ULID.
+ *
+ * @return \Symfony\Component\Uid\Ulid
+ */
+ public static function ulid()
+ {
+ return new Ulid();
+ }
+
+ /**
+ * Remove all strings from the casing caches.
+ *
+ * @return void
+ */
+ public static function flushCache()
+ {
+ static::$snakeCache = [];
+ static::$camelCache = [];
+ static::$studlyCache = [];
+ }
+}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Conditionable.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Conditionable.php
new file mode 100644
index 00000000..f5249923
--- /dev/null
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/Conditionable.php
@@ -0,0 +1,73 @@
+<?php
+
+namespace Tightenco\Collect\Support\Traits;
+
+use Closure;
+use Tightenco\Collect\Conditionable\HigherOrderWhenProxy;
+
+trait Conditionable
+{
+ /**
+ * Apply the callback if the given "value" is (or resolves to) truthy.
+ *
+ * @template TWhenParameter
+ * @template TWhenReturnType
+ *
+ * @param (\Closure($this): TWhenParameter)|TWhenParameter|null $value
+ * @param (callable($this, TWhenParameter): TWhenReturnType)|null $callback
+ * @param (callable($this, TWhenParameter): TWhenReturnType)|null $default
+ * @return $this|TWhenReturnType
+ */
+ public function when($value = null, callable $callback = null, callable $default = null)
+ {
+ $value = $value instanceof Closure ? $value($this) : $value;
+
+ if (func_num_args() === 0) {
+ return new HigherOrderWhenProxy($this);
+ }
+
+ if (func_num_args() === 1) {
+ return (new HigherOrderWhenProxy($this))->condition($value);
+ }
+
+ if ($value) {
+ return $callback($this, $value) ?? $this;
+ } elseif ($default) {
+ return $default($this, $value) ?? $this;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Apply the callback if the given "value" is (or resolves to) falsy.
+ *
+ * @template TUnlessParameter
+ * @template TUnlessReturnType
+ *
+ * @param (\Closure($this): TUnlessParameter)|TUnlessParameter|null $value
+ * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $callback
+ * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default
+ * @return $this|TUnlessReturnType
+ */
+ public function unless($value = null, callable $callback = null, callable $default = null)
+ {
+ $value = $value instanceof Closure ? $value($this) : $value;
+
+ if (func_num_args() === 0) {
+ return (new HigherOrderWhenProxy($this))->negateConditionOnCapture();
+ }
+
+ if (func_num_args() === 1) {
+ return (new HigherOrderWhenProxy($this))->condition(! $value);
+ }
+
+ if (! $value) {
+ return $callback($this, $value) ?? $this;
+ } elseif ($default) {
+ return $default($this, $value) ?? $this;
+ }
+
+ return $this;
+ }
+}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php
index 2600a223..25cde221 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/Traits/EnumeratesValues.php
@@ -11,13 +11,16 @@ use Tightenco\Collect\Support\Arr;
use Tightenco\Collect\Support\Collection;
use Tightenco\Collect\Support\Enumerable;
use Tightenco\Collect\Support\HigherOrderCollectionProxy;
-use Tightenco\Collect\Support\HigherOrderWhenProxy;
use JsonSerializable;
use Symfony\Component\VarDumper\VarDumper;
use Traversable;
use UnexpectedValueException;
+use UnitEnum;
/**
+ * @template TKey of array-key
+ * @template TValue
+ *
* @property-read HigherOrderCollectionProxy $average
* @property-read HigherOrderCollectionProxy $avg
* @property-read HigherOrderCollectionProxy $contains
@@ -34,19 +37,23 @@ use UnexpectedValueException;
* @property-read HigherOrderCollectionProxy $min
* @property-read HigherOrderCollectionProxy $partition
* @property-read HigherOrderCollectionProxy $reject
+ * @property-read HigherOrderCollectionProxy $skipUntil
+ * @property-read HigherOrderCollectionProxy $skipWhile
* @property-read HigherOrderCollectionProxy $some
* @property-read HigherOrderCollectionProxy $sortBy
* @property-read HigherOrderCollectionProxy $sortByDesc
- * @property-read HigherOrderCollectionProxy $skipUntil
- * @property-read HigherOrderCollectionProxy $skipWhile
* @property-read HigherOrderCollectionProxy $sum
* @property-read HigherOrderCollectionProxy $takeUntil
* @property-read HigherOrderCollectionProxy $takeWhile
* @property-read HigherOrderCollectionProxy $unique
+ * @property-read HigherOrderCollectionProxy $unless
* @property-read HigherOrderCollectionProxy $until
+ * @property-read HigherOrderCollectionProxy $when
*/
trait EnumeratesValues
{
+ use Conditionable;
+
/**
* Indicates that the object's string representation should be escaped when __toString is invoked.
*
@@ -57,7 +64,7 @@ trait EnumeratesValues
/**
* The methods that can be proxied.
*
- * @var string[]
+ * @var array<int, string>
*/
protected static $proxies = [
'average',
@@ -85,14 +92,19 @@ trait EnumeratesValues
'takeUntil',
'takeWhile',
'unique',
+ 'unless',
'until',
+ 'when',
];
/**
* Create a new collection instance if the value isn't one already.
*
- * @param mixed $items
- * @return static
+ * @template TMakeKey of array-key
+ * @template TMakeValue
+ *
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable<TMakeKey, TMakeValue>|iterable<TMakeKey, TMakeValue>|null $items
+ * @return static<TMakeKey, TMakeValue>
*/
public static function make($items = [])
{
@@ -102,8 +114,10 @@ trait EnumeratesValues
/**
* Wrap the given value in a collection if applicable.
*
- * @param mixed $value
- * @return static
+ * @template TWrapValue
+ *
+ * @param iterable<array-key, TWrapValue>|TWrapValue $value
+ * @return static<array-key, TWrapValue>
*/
public static function wrap($value)
{
@@ -115,8 +129,11 @@ trait EnumeratesValues
/**
* Get the underlying items from the given collection if applicable.
*
- * @param array|static $value
- * @return array
+ * @template TUnwrapKey of array-key
+ * @template TUnwrapValue
+ *
+ * @param array<TUnwrapKey, TUnwrapValue>|static<TUnwrapKey, TUnwrapValue> $value
+ * @return array<TUnwrapKey, TUnwrapValue>
*/
public static function unwrap($value)
{
@@ -136,9 +153,11 @@ trait EnumeratesValues
/**
* Create a new collection by invoking the callback a given amount of times.
*
+ * @template TTimesValue
+ *
* @param int $number
- * @param callable|null $callback
- * @return static
+ * @param (callable(int): TTimesValue)|null $callback
+ * @return static<int, TTimesValue>
*/
public static function times($number, callable $callback = null)
{
@@ -147,15 +166,15 @@ trait EnumeratesValues
}
return static::range(1, $number)
- ->when($callback)
+ ->unless($callback == null)
->map($callback);
}
/**
* Alias for the "avg" method.
*
- * @param callable|string|null $callback
- * @return mixed
+ * @param (callable(TValue): float|int)|string|null $callback
+ * @return float|int|null
*/
public function average($callback = null)
{
@@ -165,7 +184,7 @@ trait EnumeratesValues
/**
* Alias for the "contains" method.
*
- * @param mixed $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
@@ -175,39 +194,11 @@ trait EnumeratesValues
return $this->contains(...func_get_args());
}
- /**
- * Determine if an item exists, using strict comparison.
- *
- * @param mixed $key
- * @param mixed $value
- * @return bool
- */
- public function containsStrict($key, $value = null)
- {
- if (func_num_args() === 2) {
- return $this->contains(function ($item) use ($key, $value) {
- return data_get($item, $key) === $value;
- });
- }
-
- if ($this->useAsCallable($key)) {
- return ! is_null($this->first($key));
- }
-
- foreach ($this as $item) {
- if ($item === $key) {
- return true;
- }
- }
-
- return false;
- }
-
/**
* Dump the items and end the script.
*
* @param mixed ...$args
- * @return void
+ * @return never
*/
public function dd(...$args)
{
@@ -235,7 +226,7 @@ trait EnumeratesValues
/**
* Execute a callback over each item.
*
- * @param callable $callback
+ * @param callable(TValue, TKey): mixed $callback
* @return $this
*/
public function each(callable $callback)
@@ -252,7 +243,7 @@ trait EnumeratesValues
/**
* Execute a callback over each nested chunk of items.
*
- * @param callable $callback
+ * @param callable(...mixed): mixed $callback
* @return static
*/
public function eachSpread(callable $callback)
@@ -267,7 +258,7 @@ trait EnumeratesValues
/**
* Determine if all items pass the given truth test.
*
- * @param string|callable $key
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
* @param mixed $operator
* @param mixed $value
* @return bool
@@ -292,16 +283,32 @@ trait EnumeratesValues
/**
* Get the first item by the given key value pair.
*
- * @param string $key
+ * @param callable|string $key
* @param mixed $operator
* @param mixed $value
- * @return mixed
+ * @return TValue|null
*/
public function firstWhere($key, $operator = null, $value = null)
{
return $this->first($this->operatorForWhere(...func_get_args()));
}
+ /**
+ * Get a single key's value from the first matching item in the collection.
+ *
+ * @param string $key
+ * @param mixed $default
+ * @return mixed
+ */
+ public function value($key, $default = null)
+ {
+ if ($value = $this->firstWhere($key)) {
+ return data_get($value, $key, $default);
+ }
+
+ return value($default);
+ }
+
/**
* Determine if the collection is not empty.
*
@@ -315,8 +322,10 @@ trait EnumeratesValues
/**
* Run a map over each nested chunk of items.
*
- * @param callable $callback
- * @return static
+ * @template TMapSpreadValue
+ *
+ * @param callable(mixed): TMapSpreadValue $callback
+ * @return static<TKey, TMapSpreadValue>
*/
public function mapSpread(callable $callback)
{
@@ -332,8 +341,11 @@ trait EnumeratesValues
*
* The callback should return an associative array with a single key/value pair.
*
- * @param callable $callback
- * @return static
+ * @template TMapToGroupsKey of array-key
+ * @template TMapToGroupsValue
+ *
+ * @param callable(TValue, TKey): array<TMapToGroupsKey, TMapToGroupsValue> $callback
+ * @return static<TMapToGroupsKey, static<int, TMapToGroupsValue>>
*/
public function mapToGroups(callable $callback)
{
@@ -345,8 +357,11 @@ trait EnumeratesValues
/**
* Map a collection and flatten the result by a single level.
*
- * @param callable $callback
- * @return static
+ * @template TFlatMapKey of array-key
+ * @template TFlatMapValue
+ *
+ * @param callable(TValue, TKey): (\Tightenco\Collect\Support\Collection<TFlatMapKey, TFlatMapValue>|array<TFlatMapKey, TFlatMapValue>) $callback
+ * @return static<TFlatMapKey, TFlatMapValue>
*/
public function flatMap(callable $callback)
{
@@ -356,48 +371,42 @@ trait EnumeratesValues
/**
* Map the values into a new class.
*
- * @param string $class
- * @return static
+ * @template TMapIntoValue
+ *
+ * @param class-string<TMapIntoValue> $class
+ * @return static<TKey, TMapIntoValue>
*/
public function mapInto($class)
{
- return $this->map(function ($value, $key) use ($class) {
- return new $class($value, $key);
- });
+ return $this->map(fn ($value, $key) => new $class($value, $key));
}
/**
* Get the min value of a given key.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue):mixed)|string|null $callback
* @return mixed
*/
public function min($callback = null)
{
$callback = $this->valueRetriever($callback);
- return $this->map(function ($value) use ($callback) {
- return $callback($value);
- })->filter(function ($value) {
- return ! is_null($value);
- })->reduce(function ($result, $value) {
- return is_null($result) || $value < $result ? $value : $result;
- });
+ return $this->map(fn ($value) => $callback($value))
+ ->filter(fn ($value) => ! is_null($value))
+ ->reduce(fn ($result, $value) => is_null($result) || $value < $result ? $value : $result);
}
/**
* Get the max value of a given key.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue):mixed)|string|null $callback
* @return mixed
*/
public function max($callback = null)
{
$callback = $this->valueRetriever($callback);
- return $this->filter(function ($value) {
- return ! is_null($value);
- })->reduce(function ($result, $item) use ($callback) {
+ return $this->filter(fn ($value) => ! is_null($value))->reduce(function ($result, $item) use ($callback) {
$value = $callback($item);
return is_null($result) || $value > $result ? $value : $result;
@@ -421,10 +430,10 @@ trait EnumeratesValues
/**
* Partition the collection into two arrays using the given callback or key.
*
- * @param callable|string $key
- * @param mixed $operator
- * @param mixed $value
- * @return static
+ * @param (callable(TValue, TKey): bool)|TValue|string $key
+ * @param TValue|string|null $operator
+ * @param TValue|null $value
+ * @return static<int<0, 1>, static<TKey, TValue>>
*/
public function partition($key, $operator = null, $value = null)
{
@@ -449,7 +458,7 @@ trait EnumeratesValues
/**
* Get the sum of the given values.
*
- * @param callable|string|null $callback
+ * @param (callable(TValue): mixed)|string|null $callback
* @return mixed
*/
public function sum($callback = null)
@@ -458,40 +467,17 @@ trait EnumeratesValues
? $this->identity()
: $this->valueRetriever($callback);
- return $this->reduce(function ($result, $item) use ($callback) {
- return $result + $callback($item);
- }, 0);
- }
-
- /**
- * Apply the callback if the value is truthy.
- *
- * @param bool|mixed $value
- * @param callable|null $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function when($value, callable $callback = null, callable $default = null)
- {
- if (! $callback) {
- return new HigherOrderWhenProxy($this, $value);
- }
-
- if ($value) {
- return $callback($this, $value);
- } elseif ($default) {
- return $default($this, $value);
- }
-
- return $this;
+ return $this->reduce(fn ($result, $item) => $result + $callback($item), 0);
}
/**
* Apply the callback if the collection is empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TWhenEmptyReturnType
+ *
+ * @param (callable($this): TWhenEmptyReturnType) $callback
+ * @param (callable($this): TWhenEmptyReturnType)|null $default
+ * @return $this|TWhenEmptyReturnType
*/
public function whenEmpty(callable $callback, callable $default = null)
{
@@ -501,34 +487,25 @@ trait EnumeratesValues
/**
* Apply the callback if the collection is not empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TWhenNotEmptyReturnType
+ *
+ * @param callable($this): TWhenNotEmptyReturnType $callback
+ * @param (callable($this): TWhenNotEmptyReturnType)|null $default
+ * @return $this|TWhenNotEmptyReturnType
*/
public function whenNotEmpty(callable $callback, callable $default = null)
{
return $this->when($this->isNotEmpty(), $callback, $default);
}
- /**
- * Apply the callback if the value is falsy.
- *
- * @param bool $value
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
- */
- public function unless($value, callable $callback, callable $default = null)
- {
- return $this->when(! $value, $callback, $default);
- }
-
/**
* Apply the callback unless the collection is empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TUnlessEmptyReturnType
+ *
+ * @param callable($this): TUnlessEmptyReturnType $callback
+ * @param (callable($this): TUnlessEmptyReturnType)|null $default
+ * @return $this|TUnlessEmptyReturnType
*/
public function unlessEmpty(callable $callback, callable $default = null)
{
@@ -538,9 +515,11 @@ trait EnumeratesValues
/**
* Apply the callback unless the collection is not empty.
*
- * @param callable $callback
- * @param callable|null $default
- * @return static|mixed
+ * @template TUnlessNotEmptyReturnType
+ *
+ * @param callable($this): TUnlessNotEmptyReturnType $callback
+ * @param (callable($this): TUnlessNotEmptyReturnType)|null $default
+ * @return $this|TUnlessNotEmptyReturnType
*/
public function unlessNotEmpty(callable $callback, callable $default = null)
{
@@ -550,7 +529,7 @@ trait EnumeratesValues
/**
* Filter items by the given key value pair.
*
- * @param string $key
+ * @param callable|string $key
* @param mixed $operator
* @param mixed $value
* @return static
@@ -598,7 +577,7 @@ trait EnumeratesValues
* Filter items by the given key value pair.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @param bool $strict
* @return static
*/
@@ -606,16 +585,14 @@ trait EnumeratesValues
{
$values = $this->getArrayableItems($values);
- return $this->filter(function ($item) use ($key, $values, $strict) {
- return in_array(data_get($item, $key), $values, $strict);
- });
+ return $this->filter(fn ($item) => in_array(data_get($item, $key), $values, $strict));
}
/**
* Filter items by the given key value pair using strict comparison.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereInStrict($key, $values)
@@ -627,7 +604,7 @@ trait EnumeratesValues
* Filter items such that the value of the given key is between the given values.
*
* @param string $key
- * @param array $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereBetween($key, $values)
@@ -639,21 +616,21 @@ trait EnumeratesValues
* Filter items such that the value of the given key is not between the given values.
*
* @param string $key
- * @param array $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereNotBetween($key, $values)
{
- return $this->filter(function ($item) use ($key, $values) {
- return data_get($item, $key) < reset($values) || data_get($item, $key) > end($values);
- });
+ return $this->filter(
+ fn ($item) => data_get($item, $key) < reset($values) || data_get($item, $key) > end($values)
+ );
}
/**
* Filter items by the given key value pair.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @param bool $strict
* @return static
*/
@@ -661,16 +638,14 @@ trait EnumeratesValues
{
$values = $this->getArrayableItems($values);
- return $this->reject(function ($item) use ($key, $values, $strict) {
- return in_array(data_get($item, $key), $values, $strict);
- });
+ return $this->reject(fn ($item) => in_array(data_get($item, $key), $values, $strict));
}
/**
* Filter items by the given key value pair using strict comparison.
*
* @param string $key
- * @param mixed $values
+ * @param \Tightenco\Collect\Contracts\Support\Arrayable|iterable $values
* @return static
*/
public function whereNotInStrict($key, $values)
@@ -681,8 +656,10 @@ trait EnumeratesValues
/**
* Filter the items, removing any items that don't match the given type(s).
*
- * @param string|string[] $type
- * @return static
+ * @template TWhereInstanceOf
+ *
+ * @param class-string<TWhereInstanceOf>|array<array-key, class-string<TWhereInstanceOf>> $type
+ * @return static<TKey, TWhereInstanceOf>
*/
public function whereInstanceOf($type)
{
@@ -704,8 +681,10 @@ trait EnumeratesValues
/**
* Pass the collection to the given callback and return the result.
*
- * @param callable $callback
- * @return mixed
+ * @template TPipeReturnType
+ *
+ * @param callable($this): TPipeReturnType $callback
+ * @return TPipeReturnType
*/
public function pipe(callable $callback)
{
@@ -715,7 +694,7 @@ trait EnumeratesValues
/**
* Pass the collection into a new class.
*
- * @param string $class
+ * @param class-string $class
* @return mixed
*/
public function pipeInto($class)
@@ -726,38 +705,26 @@ trait EnumeratesValues
/**
* Pass the collection through a series of callable pipes and return the result.
*
- * @param array<callable> $pipes
+ * @param array<callable> $callbacks
* @return mixed
*/
- public function pipeThrough($pipes)
+ public function pipeThrough($callbacks)
{
- return static::make($pipes)->reduce(
- function ($carry, $pipe) {
- return $pipe($carry);
- },
+ return Collection::make($callbacks)->reduce(
+ fn ($carry, $callback) => $callback($carry),
$this,
);
}
- /**
- * Pass the collection to the given callback and then return it.
- *
- * @param callable $callback
- * @return $this
- */
- public function tap(callable $callback)
- {
- $callback(clone $this);
-
- return $this;
- }
-
/**
* Reduce the collection to a single value.
*
- * @param callable $callback
- * @param mixed $initial
- * @return mixed
+ * @template TReduceInitial
+ * @template TReduceReturnType
+ *
+ * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback
+ * @param TReduceInitial $initial
+ * @return TReduceReturnType
*/
public function reduce(callable $callback, $initial = null)
{
@@ -770,22 +737,6 @@ trait EnumeratesValues
return $result;
}
- /**
- * Reduce the collection to multiple aggregate values.
- *
- * @param callable $callback
- * @param mixed ...$initial
- * @return array
- *
- * @deprecated Use "reduceSpread" instead
- *
- * @throws \UnexpectedValueException
- */
- public function reduceMany(callable $callback, ...$initial)
- {
- return $this->reduceSpread($callback, ...$initial);
- }
-
/**
* Reduce the collection to multiple aggregate values.
*
@@ -804,7 +755,7 @@ trait EnumeratesValues
if (! is_array($result)) {
throw new UnexpectedValueException(sprintf(
- "%s::reduceMany expects reducer to return an array, but got a '%s' instead.",
+ "%s::reduceSpread expects reducer to return an array, but got a '%s' instead.",
class_basename(static::class), gettype($result)
));
}
@@ -813,22 +764,10 @@ trait EnumeratesValues
return $result;
}
- /**
- * Reduce an associative collection to a single value.
- *
- * @param callable $callback
- * @param mixed $initial
- * @return mixed
- */
- public function reduceWithKeys(callable $callback, $initial = null)
- {
- return $this->reduce($callback, $initial);
- }
-
/**
* Create a collection of all elements that do not pass a given truth test.
*
- * @param callable|mixed $callback
+ * @param (callable(TValue, TKey): bool)|bool|TValue $callback
* @return static
*/
public function reject($callback = true)
@@ -842,10 +781,45 @@ trait EnumeratesValues
});
}
+ /**
+ * Pass the collection to the given callback and then return it.
+ *
+ * @param callable($this): mixed $callback
+ * @return $this
+ */
+ public function tap(callable $callback)
+ {
+ $callback($this);
+
+ return $this;
+ }
+
+ /**
+ * Return only unique items from the collection array.
+ *
+ * @param (callable(TValue, TKey): mixed)|string|null $key
+ * @param bool $strict
+ * @return static
+ */
+ public function unique($key = null, $strict = false)
+ {
+ $callback = $this->valueRetriever($key);
+
+ $exists = [];
+
+ return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) {
+ if (in_array($id = $callback($item, $key), $exists, $strict)) {
+ return true;
+ }
+
+ $exists[] = $id;
+ });
+ }
+
/**
* Return only unique items from the collection array using strict comparison.
*
- * @param string|callable|null $key
+ * @param (callable(TValue, TKey): mixed)|string|null $key
* @return static
*/
public function uniqueStrict($key = null)
@@ -856,7 +830,7 @@ trait EnumeratesValues
/**
* Collect the values into a collection.
*
- * @return \Tightenco\Collect\Support\Collection
+ * @return \Tightenco\Collect\Support\Collection<TKey, TValue>
*/
public function collect()
{
@@ -866,22 +840,19 @@ trait EnumeratesValues
/**
* Get the collection of items as a plain array.
*
- * @return array
+ * @return array<TKey, mixed>
*/
public function toArray()
{
- return $this->map(function ($value) {
- return $value instanceof Arrayable ? $value->toArray() : $value;
- })->all();
+ return $this->map(fn ($value) => $value instanceof Arrayable ? $value->toArray() : $value)->all();
}
/**
* Convert the object into something JSON serializable.
*
- * @return array
+ * @return array<TKey, mixed>
*/
- #[\ReturnTypeWillChange]
- public function jsonSerialize()
+ public function jsonSerialize(): array
{
return array_map(function ($value) {
if ($value instanceof JsonSerializable) {
@@ -975,7 +946,7 @@ trait EnumeratesValues
* Results array of items from Collection or Arrayable.
*
* @param mixed $items
- * @return array
+ * @return array<TKey, TValue>
*/
protected function getArrayableItems($items)
{
@@ -985,12 +956,14 @@ trait EnumeratesValues
return $items->all();
} elseif ($items instanceof Arrayable) {
return $items->toArray();
+ } elseif ($items instanceof Traversable) {
+ return iterator_to_array($items);
} elseif ($items instanceof Jsonable) {
return json_decode($items->toJson(), true);
} elseif ($items instanceof JsonSerializable) {
return (array) $items->jsonSerialize();
- } elseif ($items instanceof Traversable) {
- return iterator_to_array($items);
+ } elseif ($items instanceof UnitEnum) {
+ return [$items];
}
return (array) $items;
@@ -999,13 +972,17 @@ trait EnumeratesValues
/**
* Get an operator checker callback.
*
- * @param string $key
+ * @param callable|string $key
* @param string|null $operator
* @param mixed $value
* @return \Closure
*/
protected function operatorForWhere($key, $operator = null, $value = null)
{
+ if ($this->useAsCallable($key)) {
+ return $key;
+ }
+
if (func_num_args() === 1) {
$value = true;
@@ -1041,6 +1018,7 @@ trait EnumeratesValues
case '>=': return $retrieved >= $value;
case '===': return $retrieved === $value;
case '!==': return $retrieved !== $value;
+ case '<=>': return $retrieved <=> $value;
}
};
}
@@ -1068,22 +1046,18 @@ trait EnumeratesValues
return $value;
}
- return function ($item) use ($value) {
- return data_get($item, $value);
- };
+ return fn ($item) => data_get($item, $value);
}
/**
* Make a function to check an item's equality.
*
* @param mixed $value
- * @return \Closure
+ * @return \Closure(mixed): bool
*/
protected function equality($value)
{
- return function ($item) use ($value) {
- return $item === $value;
- };
+ return fn ($item) => $item === $value;
}
/**
@@ -1094,20 +1068,16 @@ trait EnumeratesValues
*/
protected function negate(Closure $callback)
{
- return function (...$params) use ($callback) {
- return ! $callback(...$params);
- };
+ return fn (...$params) => ! $callback(...$params);
}
/**
* Make a function that returns what's passed to it.
*
- * @return \Closure
+ * @return \Closure(TValue): TValue
*/
protected function identity()
{
- return function ($value) {
- return $value;
- };
+ return fn ($value) => $value;
}
}
diff --git a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php
index a9c04063..d2184d20 100644
--- a/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php
+++ b/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/alias.php
@@ -9,7 +9,6 @@ $aliases = [
Tightenco\Collect\Support\Collection::class => Illuminate\Support\Collection::class,
Tightenco\Collect\Support\Enumerable::class => Illuminate\Support\Enumerable::class,
Tightenco\Collect\Support\HigherOrderCollectionProxy::class => Illuminate\Support\HigherOrderCollectionProxy::class,
- Tightenco\Collect\Support\HigherOrderWhenProxy::class => Illuminate\Support\HigherOrderWhenProxy::class,
Tightenco\Collect\Support\LazyCollection::class => Illuminate\Support\LazyCollection::class,
Tightenco\Collect\Support\Traits\EnumeratesValues::class => Illuminate\Support\Traits\EnumeratesValues::class,
];