From 2dbd6e06bdb7033ad45291f9b48926301aa80507 Mon Sep 17 00:00:00 2001 From: Ahmet Bora Date: Wed, 22 Jun 2022 14:12:33 +0300 Subject: [PATCH] 2.0.0-rc.1 --- README.md | 33 +- composer.json | 14 +- composer.lock | 575 ++++++++-------- helpers.php | 14 - index.php | 6 + src/View/Compiler/BladeCompiler.php | 27 - src/View/Concerns/ManagesLayouts.php | 60 -- src/View/Factory.php | 11 - src/View/ViewServiceProvider.php | 14 +- templates/about.blade.php | 51 -- templates/album.blade.php | 33 - templates/default.blade.php | 12 - templates/home.blade.php | 17 - templates/layouts/default.blade.php | 42 -- templates/note.blade.php | 23 - templates/notes.blade.php | 14 - templates/partials/album.blade.php | 12 - templates/partials/image.blade.php | 5 - templates/partials/note.blade.php | 8 - templates/partials/photography.blade.php | 8 - templates/photography.blade.php | 17 - vendor/autoload.php | 5 + vendor/bin/carbon | 51 +- vendor/bin/carbon.bat | 3 +- vendor/composer/ClassLoader.php | 2 +- vendor/composer/InstalledVersions.php | 16 +- vendor/composer/autoload_classmap.php | 24 +- vendor/composer/autoload_files.php | 6 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 4 +- vendor/composer/autoload_real.php | 40 +- vendor/composer/autoload_static.php | 33 +- vendor/composer/installed.json | 626 +++++++++--------- vendor/composer/installed.php | 170 ++--- vendor/illuminate/bus/Batch.php | 16 +- .../bus/DatabaseBatchRepository.php | 8 +- vendor/illuminate/bus/PendingBatch.php | 71 +- vendor/illuminate/bus/Queueable.php | 32 +- vendor/illuminate/bus/UniqueLock.php | 6 +- vendor/illuminate/bus/composer.json | 12 +- vendor/illuminate/collections/Arr.php | 90 ++- vendor/illuminate/collections/Collection.php | 376 +++++++---- vendor/illuminate/collections/Enumerable.php | 526 ++++++++++----- .../illuminate/collections/LazyCollection.php | 318 +++++---- .../MultipleItemsFoundException.php | 31 + .../collections/Traits/EnumeratesValues.php | 341 +++++----- vendor/illuminate/collections/composer.json | 11 +- vendor/illuminate/collections/helpers.php | 9 +- .../HigherOrderWhenProxy.php | 27 +- .../conditionable/LICENSE.md} | 12 +- .../conditionable/Traits/Conditionable.php | 65 ++ vendor/illuminate/conditionable/composer.json | 33 + vendor/illuminate/container/BoundMethod.php | 10 +- vendor/illuminate/container/Container.php | 30 +- .../container/ContextualBindingBuilder.php | 6 +- .../container/RewindableGenerator.php | 9 +- vendor/illuminate/container/Util.php | 5 +- vendor/illuminate/container/composer.json | 10 +- vendor/illuminate/contracts/Auth/Guard.php | 7 + .../contracts/Auth/PasswordBrokerFactory.php | 2 +- .../contracts/Broadcasting/Broadcaster.php | 2 + .../contracts/Container/Container.php | 27 + .../Container/ContextualBindingBuilder.php | 9 + .../contracts/Database/Eloquent/Builder.php | 14 + .../contracts/Database/Query/Builder.php | 12 + .../contracts/Debug/ExceptionHandler.php | 2 + .../contracts/Encryption/Encrypter.php | 7 + .../Filesystem/FileExistsException.php | 10 - .../contracts/Filesystem/Filesystem.php | 9 +- .../contracts/Foundation/Application.php | 18 +- .../Foundation/ExceptionRenderer.php | 14 + .../contracts/Foundation/MaintenanceMode.php | 35 + .../illuminate/contracts/Mail/Attachable.php | 13 + vendor/illuminate/contracts/Mail/Mailable.php | 4 +- vendor/illuminate/contracts/Mail/Mailer.php | 11 +- .../contracts/Pagination/Paginator.php | 4 +- vendor/illuminate/contracts/Queue/Job.php | 4 +- vendor/illuminate/contracts/Queue/Monitor.php | 2 +- vendor/illuminate/contracts/Queue/Queue.php | 4 +- .../contracts/Queue/QueueableCollection.php | 4 +- .../contracts/Routing/UrlGenerator.php | 7 + .../Middleware/AuthenticatesSessions.php | 8 + .../contracts/Support/Arrayable.php | 6 +- .../contracts/Validation/InvokableRule.php | 16 + vendor/illuminate/contracts/composer.json | 8 +- vendor/illuminate/events/Dispatcher.php | 59 +- vendor/illuminate/events/NullDispatcher.php | 2 +- vendor/illuminate/events/QueuedClosure.php | 8 +- vendor/illuminate/events/composer.json | 16 +- .../illuminate/filesystem/AwsS3V3Adapter.php | 94 +++ vendor/illuminate/filesystem/Cache.php | 71 -- vendor/illuminate/filesystem/Filesystem.php | 36 +- .../filesystem/FilesystemAdapter.php | 519 +++++++++------ .../filesystem/FilesystemManager.php | 152 +++-- vendor/illuminate/filesystem/composer.json | 26 +- vendor/illuminate/macroable/composer.json | 4 +- vendor/illuminate/pipeline/Pipeline.php | 15 +- vendor/illuminate/pipeline/composer.json | 8 +- vendor/illuminate/support/Carbon.php | 3 + .../support/ConfigurationUrlParser.php | 4 +- vendor/illuminate/support/DateFactory.php | 4 +- vendor/illuminate/support/Env.php | 4 +- vendor/illuminate/support/Facades/App.php | 1 + vendor/illuminate/support/Facades/Blade.php | 5 +- .../illuminate/support/Facades/Broadcast.php | 5 +- vendor/illuminate/support/Facades/Bus.php | 5 + vendor/illuminate/support/Facades/Cache.php | 4 +- vendor/illuminate/support/Facades/DB.php | 1 + vendor/illuminate/support/Facades/Date.php | 18 +- vendor/illuminate/support/Facades/Event.php | 2 +- vendor/illuminate/support/Facades/Facade.php | 92 ++- vendor/illuminate/support/Facades/File.php | 2 + vendor/illuminate/support/Facades/Http.php | 64 +- vendor/illuminate/support/Facades/Log.php | 2 + vendor/illuminate/support/Facades/Mail.php | 19 +- .../support/Facades/Notification.php | 1 + vendor/illuminate/support/Facades/Queue.php | 5 +- .../support/Facades/RateLimiter.php | 2 +- .../illuminate/support/Facades/Redirect.php | 8 +- vendor/illuminate/support/Facades/Route.php | 3 + vendor/illuminate/support/Facades/Schema.php | 20 +- vendor/illuminate/support/Facades/Storage.php | 7 +- vendor/illuminate/support/Facades/URL.php | 1 + .../illuminate/support/Facades/Validator.php | 2 + vendor/illuminate/support/Facades/View.php | 1 + vendor/illuminate/support/Fluent.php | 68 +- vendor/illuminate/support/Js.php | 2 +- vendor/illuminate/support/MessageBag.php | 8 +- .../support/MultipleInstanceManager.php | 191 ++++++ .../support/NamespacedItemResolver.php | 2 +- vendor/illuminate/support/Optional.php | 12 +- vendor/illuminate/support/Pluralizer.php | 90 +-- vendor/illuminate/support/ProcessUtils.php | 8 +- vendor/illuminate/support/Reflector.php | 30 +- vendor/illuminate/support/Str.php | 379 +++++++++-- vendor/illuminate/support/Stringable.php | 304 ++++++++- .../support/Testing/Fakes/BusFake.php | 71 +- .../support/Testing/Fakes/EventFake.php | 25 +- .../support/Testing/Fakes/MailFake.php | 52 +- .../Testing/Fakes/NotificationFake.php | 62 +- .../support/Testing/Fakes/QueueFake.php | 103 ++- .../support/Traits/Conditionable.php | 44 -- vendor/illuminate/support/ValidatedInput.php | 50 +- vendor/illuminate/support/ViewErrorBag.php | 3 +- vendor/illuminate/support/composer.json | 25 +- vendor/illuminate/support/helpers.php | 53 +- vendor/illuminate/view/AnonymousComponent.php | 2 +- .../view/Compilers/BladeCompiler.php | 119 +++- vendor/illuminate/view/Compilers/Compiler.php | 45 +- .../view/Compilers/ComponentTagCompiler.php | 63 +- .../Compilers/Concerns/CompilesComponents.php | 11 +- .../Concerns/CompilesConditionals.php | 67 ++ .../view/Compilers/Concerns/CompilesEchos.php | 2 +- .../Compilers/Concerns/CompilesIncludes.php | 2 +- .../Compilers/Concerns/CompilesStacks.php | 58 ++ vendor/illuminate/view/Component.php | 5 +- .../illuminate/view/ComponentAttributeBag.php | 40 +- .../view/Concerns/ManagesEvents.php | 6 +- .../illuminate/view/Concerns/ManagesLoops.php | 6 +- vendor/illuminate/view/Factory.php | 19 +- vendor/illuminate/view/FileViewFinder.php | 4 +- .../view/InvokableComponentVariable.php | 4 +- vendor/illuminate/view/View.php | 18 +- vendor/illuminate/view/ViewException.php | 2 +- vendor/illuminate/view/ViewName.php | 2 +- .../illuminate/view/ViewServiceProvider.php | 8 +- vendor/illuminate/view/composer.json | 18 +- vendor/nesbot/carbon/composer.json | 61 +- .../lazy/Carbon/PHPStan/MacroStrongType.php | 43 ++ .../lazy/Carbon/PHPStan/MacroWeakType.php | 49 ++ vendor/nesbot/carbon/readme.md | 4 + .../carbon/src/Carbon/AbstractTranslator.php | 25 +- .../carbon/src/Carbon/CarbonInterface.php | 1 + .../carbon/src/Carbon/CarbonInterval.php | 87 ++- .../nesbot/carbon/src/Carbon/CarbonPeriod.php | 33 +- .../carbon/src/Carbon/CarbonTimeZone.php | 26 +- .../Carbon/Doctrine/CarbonTypeConverter.php | 13 +- .../Exceptions/BadComparisonUnitException.php | 25 +- .../BadFluentConstructorException.php | 25 +- .../Exceptions/BadFluentSetterException.php | 29 +- .../Exceptions/BadMethodCallException.php | 1 + .../src/Carbon/Exceptions/Exception.php | 1 + .../Carbon/Exceptions/ImmutableException.php | 24 +- .../Exceptions/InvalidArgumentException.php | 1 + .../Exceptions/InvalidCastException.php | 13 +- .../Exceptions/InvalidDateException.php | 6 +- .../Exceptions/InvalidFormatException.php | 13 +- .../Exceptions/InvalidIntervalException.php | 13 +- .../Exceptions/InvalidPeriodDateException.php | 13 +- .../InvalidPeriodParameterException.php | 13 +- .../Exceptions/InvalidTimeZoneException.php | 13 +- .../Exceptions/InvalidTypeException.php | 13 +- .../Exceptions/NotACarbonClassException.php | 31 +- .../Carbon/Exceptions/NotAPeriodException.php | 13 +- .../Exceptions/NotLocaleAwareException.php | 6 +- .../Carbon/Exceptions/OutOfRangeException.php | 6 +- .../Carbon/Exceptions/ParseErrorException.php | 61 +- .../Carbon/Exceptions/RuntimeException.php | 1 + .../src/Carbon/Exceptions/UnitException.php | 13 +- .../Exceptions/UnitNotConfiguredException.php | 25 +- .../Exceptions/UnknownGetterException.php | 29 +- .../Exceptions/UnknownMethodException.php | 25 +- .../Exceptions/UnknownSetterException.php | 29 +- .../Exceptions/UnknownUnitException.php | 25 +- .../Exceptions/UnreachableException.php | 13 +- vendor/nesbot/carbon/src/Carbon/Lang/ckb.php | 89 +++ vendor/nesbot/carbon/src/Carbon/Lang/cy.php | 2 +- vendor/nesbot/carbon/src/Carbon/Lang/da.php | 7 +- vendor/nesbot/carbon/src/Carbon/Lang/en.php | 2 +- vendor/nesbot/carbon/src/Carbon/Lang/fr.php | 2 +- vendor/nesbot/carbon/src/Carbon/Lang/mn.php | 62 +- vendor/nesbot/carbon/src/Carbon/Lang/pl.php | 27 +- vendor/nesbot/carbon/src/Carbon/Lang/ss.php | 2 +- vendor/nesbot/carbon/src/Carbon/Lang/sv.php | 2 +- .../nesbot/carbon/src/Carbon/Lang/szl_PL.php | 18 +- .../src/Carbon/PHPStan/AbstractMacro.php | 222 +++++++ .../carbon/src/Carbon/PHPStan/Macro.php | 232 +------ .../carbon/src/Carbon/Traits/Comparison.php | 26 +- .../carbon/src/Carbon/Traits/Converter.php | 2 +- .../carbon/src/Carbon/Traits/Creator.php | 4 +- .../nesbot/carbon/src/Carbon/Traits/Date.php | 23 +- .../carbon/src/Carbon/Traits/Difference.php | 23 +- .../carbon/src/Carbon/Traits/Localization.php | 22 +- .../nesbot/carbon/src/Carbon/Traits/Mixin.php | 6 +- .../carbon/src/Carbon/Traits/Rounding.php | 4 +- .../src/Carbon/Traits/Serialization.php | 2 +- .../nesbot/carbon/src/Carbon/Traits/Test.php | 44 +- .../carbon/src/Carbon/Traits/Timestamp.php | 4 +- .../nesbot/carbon/src/Carbon/Traits/Units.php | 10 +- .../carbon/src/Carbon/TranslatorImmutable.php | 99 +++ vendor/psr/container/composer.json | 5 + .../psr/container/src/ContainerInterface.php | 2 +- vendor/psr/simple-cache/composer.json | 6 +- .../psr/simple-cache/src/CacheException.php | 2 +- .../psr/simple-cache/src/CacheInterface.php | 24 +- .../css-selector/CssSelectorConverter.php | 10 +- .../Exception/SyntaxErrorException.php | 25 +- vendor/symfony/css-selector/LICENSE | 2 +- .../css-selector/Node/AbstractNode.php | 11 +- .../css-selector/Node/AttributeNode.php | 8 +- .../symfony/css-selector/Node/ClassNode.php | 2 +- .../Node/CombinedSelectorNode.php | 2 +- .../symfony/css-selector/Node/ElementNode.php | 4 +- .../css-selector/Node/FunctionNode.php | 4 +- vendor/symfony/css-selector/Node/HashNode.php | 2 +- .../symfony/css-selector/Node/PseudoNode.php | 2 +- .../css-selector/Node/SelectorNode.php | 2 +- .../symfony/css-selector/Node/Specificity.php | 6 +- vendor/symfony/css-selector/Parser/Reader.php | 11 +- vendor/symfony/css-selector/Parser/Token.php | 6 +- .../css-selector/Parser/TokenStream.php | 27 +- .../Parser/Tokenizer/Tokenizer.php | 2 +- .../Parser/Tokenizer/TokenizerPatterns.php | 24 +- .../XPath/Extension/NodeExtension.php | 4 +- .../symfony/css-selector/XPath/Translator.php | 18 +- .../symfony/css-selector/XPath/XPathExpr.php | 14 +- vendor/symfony/css-selector/composer.json | 3 +- .../symfony/deprecation-contracts/.gitignore | 3 - .../deprecation-contracts/CHANGELOG.md | 5 - .../symfony/deprecation-contracts/README.md | 26 - .../deprecation-contracts/composer.json | 35 - .../deprecation-contracts/function.php | 27 - vendor/symfony/finder/CHANGELOG.md | 5 + .../symfony/finder/Comparator/Comparator.php | 67 +- vendor/symfony/finder/Finder.php | 114 ++-- vendor/symfony/finder/Glob.php | 4 +- .../finder/Iterator/CustomFilterIterator.php | 7 +- .../Iterator/DateRangeFilterIterator.php | 7 +- .../Iterator/DepthRangeFilterIterator.php | 7 +- .../ExcludeDirectoryFilterIterator.php | 25 +- .../Iterator/FileTypeFilterIterator.php | 7 +- .../Iterator/FilecontentFilterIterator.php | 9 +- .../Iterator/FilenameFilterIterator.php | 9 +- .../symfony/finder/Iterator/LazyIterator.php | 4 +- .../Iterator/MultiplePcreFilterIterator.php | 20 +- .../finder/Iterator/PathFilterIterator.php | 9 +- .../Iterator/RecursiveDirectoryIterator.php | 49 +- .../Iterator/SizeRangeFilterIterator.php | 7 +- .../finder/Iterator/SortableIterator.php | 14 +- .../Iterator/VcsIgnoredFilterIterator.php | 2 - vendor/symfony/finder/LICENSE | 2 +- vendor/symfony/finder/SplFileInfo.php | 16 +- vendor/symfony/finder/composer.json | 4 +- vendor/symfony/polyfill-mbstring/Mbstring.php | 7 +- vendor/symfony/polyfill-mbstring/README.md | 2 +- .../symfony/polyfill-mbstring/composer.json | 5 +- vendor/symfony/polyfill-php80/Php80.php | 12 +- vendor/symfony/polyfill-php80/PhpToken.php | 103 +++ vendor/symfony/polyfill-php80/README.md | 7 +- .../Resources/stubs/PhpToken.php | 7 + .../Resources/stubs/UnhandledMatchError.php | 6 +- .../Resources/stubs/ValueError.php | 6 +- vendor/symfony/polyfill-php80/composer.json | 2 +- vendor/symfony/translation-contracts/LICENSE | 2 +- .../Catalogue/AbstractOperation.php | 13 +- .../Command/TranslationPullCommand.php | 2 +- .../Command/TranslationPushCommand.php | 9 +- .../TranslationDataCollector.php | 3 - .../TranslatorPathsPass.php | 2 +- vendor/symfony/translation/LICENSE | 2 +- .../translation/Loader/XliffFileLoader.php | 2 +- .../PseudoLocalizationTranslator.php | 2 +- .../translation/Resources/data/parents.json | 3 + .../translation/Test/ProviderTestCase.php | 10 - vendor/symfony/translation/TranslatorBag.php | 5 +- vendor/voku/html-min/CHANGELOG.md | 15 + vendor/voku/html-min/README.md | 4 +- vendor/voku/html-min/composer.json | 6 +- vendor/voku/html-min/renovate.json | 11 + .../voku/html-min/src/voku/helper/HtmlMin.php | 67 +- vendor/voku/portable-ascii/CHANGELOG.md | 25 + vendor/voku/portable-ascii/README.md | 49 +- .../voku/portable-ascii/build/composer.json | 5 - vendor/voku/portable-ascii/build/docs/base.md | 127 ---- .../portable-ascii/build/generate_docs.php | 26 - .../build/generate_max_key_length.php | 20 - .../portable-ascii/src/voku/helper/ASCII.php | 179 +++-- .../voku/helper/data/ascii_by_languages.php | 149 +++-- .../helper/data/ascii_extras_by_languages.php | 8 +- .../helper/data/ascii_language_max_key.php | 2 +- .../simple_html_dom/.github/workflows/ci.yml | 8 +- vendor/voku/simple_html_dom/CHANGELOG | 10 + vendor/voku/simple_html_dom/README_API.md | 144 ++-- vendor/voku/simple_html_dom/composer.json | 2 +- .../src/voku/helper/AbstractDomParser.php | 18 +- .../src/voku/helper/AbstractSimpleHtmlDom.php | 17 +- .../src/voku/helper/AbstractSimpleXmlDom.php | 7 +- .../src/voku/helper/DomParserInterface.php | 11 +- .../src/voku/helper/HtmlDomHelper.php | 73 ++ .../src/voku/helper/HtmlDomParser.php | 120 +++- .../src/voku/helper/SimpleHtmlDom.php | 56 +- .../src/voku/helper/SimpleHtmlDomBlank.php | 31 +- .../voku/helper/SimpleHtmlDomInterface.php | 26 +- .../src/voku/helper/SimpleHtmlDomNode.php | 12 +- .../voku/helper/SimpleHtmlDomNodeBlank.php | 4 +- .../helper/SimpleHtmlDomNodeInterface.php | 4 +- .../src/voku/helper/SimpleXmlDom.php | 12 +- .../src/voku/helper/SimpleXmlDomBlank.php | 6 +- .../src/voku/helper/SimpleXmlDomInterface.php | 3 +- .../src/voku/helper/SimpleXmlDomNode.php | 13 +- .../src/voku/helper/SimpleXmlDomNodeBlank.php | 4 +- .../voku/helper/SimpleXmlDomNodeInterface.php | 4 +- .../src/voku/helper/XmlDomParser.php | 21 +- 343 files changed, 7223 insertions(+), 4427 deletions(-) delete mode 100644 helpers.php delete mode 100644 src/View/Concerns/ManagesLayouts.php delete mode 100644 src/View/Factory.php delete mode 100644 templates/about.blade.php delete mode 100644 templates/album.blade.php delete mode 100644 templates/default.blade.php delete mode 100644 templates/home.blade.php delete mode 100644 templates/layouts/default.blade.php delete mode 100644 templates/note.blade.php delete mode 100644 templates/notes.blade.php delete mode 100644 templates/partials/album.blade.php delete mode 100644 templates/partials/image.blade.php delete mode 100644 templates/partials/note.blade.php delete mode 100644 templates/partials/photography.blade.php delete mode 100644 templates/photography.blade.php rename vendor/illuminate/{collections => conditionable}/HigherOrderWhenProxy.php (54%) rename vendor/{symfony/deprecation-contracts/LICENSE => illuminate/conditionable/LICENSE.md} (83%) create mode 100644 vendor/illuminate/conditionable/Traits/Conditionable.php create mode 100644 vendor/illuminate/conditionable/composer.json create mode 100644 vendor/illuminate/contracts/Database/Eloquent/Builder.php create mode 100644 vendor/illuminate/contracts/Database/Query/Builder.php delete mode 100644 vendor/illuminate/contracts/Filesystem/FileExistsException.php create mode 100644 vendor/illuminate/contracts/Foundation/ExceptionRenderer.php create mode 100644 vendor/illuminate/contracts/Foundation/MaintenanceMode.php create mode 100644 vendor/illuminate/contracts/Mail/Attachable.php create mode 100644 vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php create mode 100644 vendor/illuminate/contracts/Validation/InvokableRule.php create mode 100644 vendor/illuminate/filesystem/AwsS3V3Adapter.php delete mode 100644 vendor/illuminate/filesystem/Cache.php create mode 100644 vendor/illuminate/support/MultipleInstanceManager.php delete mode 100644 vendor/illuminate/support/Traits/Conditionable.php create mode 100644 vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php create mode 100644 vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php create mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ckb.php create mode 100644 vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php create mode 100644 vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php delete mode 100644 vendor/symfony/deprecation-contracts/.gitignore delete mode 100644 vendor/symfony/deprecation-contracts/CHANGELOG.md delete mode 100644 vendor/symfony/deprecation-contracts/README.md delete mode 100644 vendor/symfony/deprecation-contracts/composer.json delete mode 100644 vendor/symfony/deprecation-contracts/function.php create mode 100644 vendor/symfony/polyfill-php80/PhpToken.php create mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php create mode 100644 vendor/voku/html-min/renovate.json delete mode 100644 vendor/voku/portable-ascii/build/composer.json delete mode 100644 vendor/voku/portable-ascii/build/docs/base.md delete mode 100644 vendor/voku/portable-ascii/build/generate_docs.php delete mode 100644 vendor/voku/portable-ascii/build/generate_max_key_length.php create mode 100644 vendor/voku/simple_html_dom/src/voku/helper/HtmlDomHelper.php diff --git a/README.md b/README.md index f4f5061..f293581 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ [![Release](https://img.shields.io/github/v/release/afbora/kirby-blade?style=flat-square)](https://github.com/afbora/kirby-blade) [![License](https://img.shields.io/github/license/afbora/kirby-blade?style=flat-square)](https://github.com/afbora/kirby-blade) -Kirby Blade use Laravel `illuminate/view` 8.x package and compatible with Kirby 3. +Kirby Blade use Laravel `illuminate/view` 9.x package and compatible with Kirby 3. -This package enable [Laravel Blade](https://laravel.com/docs/8.x/blade) for your own Kirby applications. +This package enable [Laravel Blade](https://laravel.com/docs/9.x/blade) for your own Kirby applications. ## Installation @@ -33,9 +33,9 @@ According to Laravel Blade documentation is: ## Usage -You can use the power of Blade like [Layouts](https://laravel.com/docs/8.x/blade#building-layouts), [Forms](https://laravel.com/docs/8.x/blade#forms), [Sub-Views](https://laravel.com/docs/8.x/blade#including-subviews), [Components](https://laravel.com/docs/8.x/blade#components), [Directives](https://laravel.com/docs/8.x/blade#blade-directives) and your custom if statements. +You can use the power of Blade like [Layouts](https://laravel.com/docs/9.x/blade#building-layouts), [Forms](https://laravel.com/docs/9.x/blade#forms), [Sub-Views](https://laravel.com/docs/9.x/blade#including-subviews), [Components](https://laravel.com/docs/9.x/blade#components), [Directives](https://laravel.com/docs/9.x/blade#blade-directives) and your custom if statements. -All the documentation about Laravel Blade is in the [official documentation](https://laravel.com/docs/8.x/blade). +All the documentation about Laravel Blade is in the [official documentation](https://laravel.com/docs/9.x/blade). ## Options @@ -60,25 +60,6 @@ Default templates folder is `site/templates` directory or wherever you define yo 'afbora.blade.templates' => '/theme/default/templates', ``` -You can find Kirby Starterkit blade templates in repository `/templates` folder. - -``` -├── layouts -│ └── default.blade.php -├── partials -│ ├── album.blade.php -│ ├── image.blade.php -│ ├── note.blade.php -│ └── photography.blade.php -├── about.blade.php -├── album.blade.php -├── default.blade.php -├── home.blade.php -├── note.blade.php -├── notes.blade.php -└── photography.blade.php -``` - ### Views All the views generated are stored in `site/cache/views` directory or wherever you define your `cache` directory, but you can change this easily: @@ -167,10 +148,6 @@ After declaration you can use it like: @endlogged ``` -### Filters - -**Breaking Change: After the 1.6 version, the filters feature has been removed. Use 1.5.x to use filters.** - ### Minify **Setup** @@ -212,5 +189,3 @@ After declaration you can use it like: | doRemoveOmittedQuotes | remove quotes e.g. class="lall" => class=lall | | doRemoveOmittedHtmlTags | remove ommitted html tags e.g. \lall\<\/p\> => \lall | You can get detailed information from `HtmlMin` library: [voku/HtmlMin](https://github.com/voku/HtmlMin#options) - -*Developed from [Kirby Blade Repository](https://github.com/beebmx/kirby-blade) maintained by [@beebmx](https://github.com/beebmx)* diff --git a/composer.json b/composer.json index c650f13..568a87b 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "template", "template-engine" ], - "version": "1.9.2", + "version": "2.0.0-rc.1", "type": "kirby-plugin", "license": "MIT", "authors": [ @@ -23,20 +23,20 @@ } ], "require": { - "php": "^7.3|^8.0", + "php": "^7.4|^8.0", "getkirby/composer-installer": "^1.2", - "illuminate/view": "^8.0", - "voku/html-min": "^4.4" + "illuminate/view": "^9.0", + "voku/html-min": "^4.5" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, + "extra": { + "installer-name": "kirby-blade" + }, "autoload": { - "files": [ - "helpers.php" - ], "psr-4": { "Afbora\\": "src/" } diff --git a/composer.lock b/composer.lock index ea40dbe..0e430c4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dc35520897070595a9baa8d96ec4b5cb", + "content-hash": "f413d52eccdc3332d5399ae516c2ba1e", "packages": [ { "name": "doctrine/inflector", @@ -146,24 +146,24 @@ }, { "name": "illuminate/bus", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0" + "reference": "14060207ad684e6ea29b9ff3f349813d1d2a2a0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0", - "reference": "82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0", + "url": "https://api.github.com/repos/illuminate/bus/zipball/14060207ad684e6ea29b9ff3f349813d1d2a2a0a", + "reference": "14060207ad684e6ea29b9ff3f349813d1d2a2a0a", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/pipeline": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/pipeline": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" }, "suggest": { "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." @@ -171,7 +171,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -195,43 +195,44 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-11-23T19:43:42+00:00" + "time": "2022-06-15T06:56:01+00:00" }, { "name": "illuminate/collections", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "5a018387352afa2af30fd2be0a78c31e93295720" + "reference": "239c9274b8008fb9532ada0899365d1e182f8f9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/5a018387352afa2af30fd2be0a78c31e93295720", - "reference": "5a018387352afa2af30fd2be0a78c31e93295720", + "url": "https://api.github.com/repos/illuminate/collections/zipball/239c9274b8008fb9532ada0899365d1e182f8f9d", + "reference": "239c9274b8008fb9532ada0899365d1e182f8f9d", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "php": "^8.0.2" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -249,34 +250,80 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-12-07T14:48:29+00:00" + "time": "2022-06-19T21:41:21+00:00" + }, + { + "name": "illuminate/conditionable", + "version": "v9.18.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/conditionable.git", + "reference": "46b7beed47948bd2e67f523d0a76daa62775031e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/46b7beed47948bd2e67f523d0a76daa62775031e", + "reference": "46b7beed47948bd2e67f523d0a76daa62775031e", + "shasum": "" + }, + "require": { + "php": "^8.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Conditionable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-05-31T14:47:50+00:00" }, { "name": "illuminate/container", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "6ac391bb27391706c5f921b85060aa2c4ca03fae" + "reference": "d86b073cae04713cf28def54417fa771621bc4f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/6ac391bb27391706c5f921b85060aa2c4ca03fae", - "reference": "6ac391bb27391706c5f921b85060aa2c4ca03fae", + "url": "https://api.github.com/repos/illuminate/container/zipball/d86b073cae04713cf28def54417fa771621bc4f1", + "reference": "d86b073cae04713cf28def54417fa771621bc4f1", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "php": "^7.3|^8.0", - "psr/container": "^1.0" + "illuminate/contracts": "^9.0", + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.1|2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -300,31 +347,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-11-17T15:04:30+00:00" + "time": "2022-05-16T15:53:09+00:00" }, { "name": "illuminate/contracts", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f" + "reference": "e014cf88ef46065b8b1f078893c01189b95ffb11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f", - "reference": "b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/e014cf88ef46065b8b1f078893c01189b95ffb11", + "reference": "e014cf88ef46065b8b1f078893c01189b95ffb11", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -348,44 +395,44 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-12-07T08:18:44+00:00" + "time": "2022-06-07T19:28:00+00:00" }, { "name": "illuminate/events", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" + "reference": "2dea521665d295f6cefef78f1b5abeea6b94e35f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", - "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "url": "https://api.github.com/repos/illuminate/events/zipball/2dea521665d295f6cefef78f1b5abeea6b94e35f", + "reference": "2dea521665d295f6cefef78f1b5abeea6b94e35f", "shasum": "" }, "require": { - "illuminate/bus": "^8.0", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/bus": "^9.0", + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { - "psr-4": { - "Illuminate\\Events\\": "" - }, "files": [ "functions.php" - ] + ], + "psr-4": { + "Illuminate\\Events\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -403,45 +450,45 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-09-15T14:32:50+00:00" + "time": "2022-05-02T13:59:45+00:00" }, { "name": "illuminate/filesystem", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf" + "reference": "0a73863f90e905d1d5053108fa2a270b2ec6fb0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf", - "reference": "b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/0a73863f90e905d1d5053108fa2a270b2ec6fb0f", + "reference": "0a73863f90e905d1d5053108fa2a270b2ec6fb0f", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/finder": "^5.4" + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2", + "symfony/finder": "^6.0" }, "suggest": { "ext-ftp": "Required to use the Flysystem FTP driver.", "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", + "league/flysystem": "Required to use the Flysystem local driver (^3.0.16).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", - "symfony/mime": "Required to enable support for guessing extensions (^5.4)." + "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", + "symfony/mime": "Required to enable support for guessing extensions (^6.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -465,29 +512,29 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-11-30T14:13:40+00:00" + "time": "2022-06-20T16:41:48+00:00" }, { "name": "illuminate/macroable", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "aed81891a6e046fdee72edd497f822190f61c162" + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", - "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354", + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -511,31 +558,31 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-11-16T13:57:03+00:00" + "time": "2022-02-01T14:44:21+00:00" }, { "name": "illuminate/pipeline", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", - "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2" + "reference": "e0be3f3f79f8235ad7334919ca4094d5074e02f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", - "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "url": "https://api.github.com/repos/illuminate/pipeline/zipball/e0be3f3f79f8235ad7334919ca4094d5074e02f6", + "reference": "e0be3f3f79f8235ad7334919ca4094d5074e02f6", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -559,57 +606,58 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-03-26T18:39:16+00:00" + "time": "2022-06-09T14:13:53+00:00" }, { "name": "illuminate/support", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "f542bb78a8a1013ab33fbe14974c45b2a88993d0" + "reference": "07b158210af5aaca51049c8e87606046ae6573e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/f542bb78a8a1013ab33fbe14974c45b2a88993d0", - "reference": "f542bb78a8a1013ab33fbe14974c45b2a88993d0", + "url": "https://api.github.com/repos/illuminate/support/zipball/07b158210af5aaca51049c8e87606046ae6573e2", + "reference": "07b158210af5aaca51049c8e87606046ae6573e2", "shasum": "" }, "require": { - "doctrine/inflector": "^1.4|^2.0", + "doctrine/inflector": "^2.0", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", + "illuminate/collections": "^9.0", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", "nesbot/carbon": "^2.53.1", - "php": "^7.3|^8.0", - "voku/portable-ascii": "^1.4.8" + "php": "^8.0.2", + "voku/portable-ascii": "^2.0" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "illuminate/filesystem": "Required to use the composer class (^9.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^5.4).", - "symfony/var-dumper": "Required to use the dd function (^5.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + "symfony/process": "Required to use the composer class (^6.0).", + "symfony/var-dumper": "Required to use the dd function (^6.0).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -627,37 +675,37 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-12-03T15:33:45+00:00" + "time": "2022-06-21T14:08:45+00:00" }, { "name": "illuminate/view", - "version": "v8.75.0", + "version": "v9.18.0", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "85a20375dc9083191eb5350a6a9e4a392ebb3148" + "reference": "7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/85a20375dc9083191eb5350a6a9e4a392ebb3148", - "reference": "85a20375dc9083191eb5350a6a9e4a392ebb3148", + "url": "https://api.github.com/repos/illuminate/view/zipball/7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3", + "reference": "7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/events": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/events": "^9.0", + "illuminate/filesystem": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "autoload": { @@ -681,20 +729,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-12-07T08:18:44+00:00" + "time": "2022-06-15T07:05:00+00:00" }, { "name": "nesbot/carbon", - "version": "2.55.2", + "version": "2.58.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2" + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8c2a18ce3e67c34efc1b29f64fe61304368259a2", - "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055", + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055", "shasum": "" }, "require": { @@ -711,8 +759,9 @@ "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", - "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "phpstan/phpstan": "^0.12.54 || ^1.0", + "phpunit/php-file-iterator": "^2.0.5", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", "squizlabs/php_codesniffer": "^3.4" }, "bin": [ @@ -777,26 +826,31 @@ "type": "tidelift" } ], - "time": "2021-12-03T14:59:52+00:00" + "time": "2022-04-25T19:31:17+00:00" }, { "name": "psr/container", - "version": "1.1.2", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -823,31 +877,31 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { "name": "psr/simple-cache", - "version": "1.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -862,7 +916,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -874,27 +928,26 @@ "simple-cache" ], "support": { - "source": "https://github.com/php-fig/simple-cache/tree/master" + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" }, - "time": "2017-10-23T01:57:42+00:00" + "time": "2021-10-29T13:26:27+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.0", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "44b933f98bb4b5220d10bed9ce5662f8c2d13dcc" + "reference": "1955d595c12c111629cc814d3f2a2ff13580508a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/44b933f98bb4b5220d10bed9ce5662f8c2d13dcc", - "reference": "44b933f98bb4b5220d10bed9ce5662f8c2d13dcc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/1955d595c12c111629cc814d3f2a2ff13580508a", + "reference": "1955d595c12c111629cc814d3f2a2ff13580508a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -926,74 +979,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-09-09T08:06:01+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/css-selector/tree/v6.0.3" }, "funding": [ { @@ -1009,26 +995,24 @@ "type": "tidelift" } ], - "time": "2021-11-01T23:48:49+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/finder", - "version": "v5.4.0", + "version": "v6.0.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "url": "https://api.github.com/repos/symfony/finder/zipball/af7edab28d17caecd1f40a9219fc646ae751c21f", + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -1056,7 +1040,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.0" + "source": "https://github.com/symfony/finder/tree/v6.0.8" }, "funding": [ { @@ -1072,32 +1056,35 @@ "type": "tidelift" } ], - "time": "2021-11-28T15:25:38+00:00" + "time": "2022-04-15T08:07:58+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1105,12 +1092,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1136,7 +1123,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -1152,20 +1139,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -1174,7 +1161,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1182,12 +1169,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1219,7 +1206,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -1235,20 +1222,20 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/translation", - "version": "v6.0.1", + "version": "v6.0.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b7956e00c6e03546f2ba489fc50f7c47933e76b8" + "reference": "9ba011309943955a3807b8236c17cff3b88f67b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b7956e00c6e03546f2ba489fc50f7c47933e76b8", - "reference": "b7956e00c6e03546f2ba489fc50f7c47933e76b8", + "url": "https://api.github.com/repos/symfony/translation/zipball/9ba011309943955a3807b8236c17cff3b88f67b6", + "reference": "9ba011309943955a3807b8236c17cff3b88f67b6", "shasum": "" }, "require": { @@ -1314,7 +1301,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.1" + "source": "https://github.com/symfony/translation/tree/v6.0.9" }, "funding": [ { @@ -1330,20 +1317,20 @@ "type": "tidelift" } ], - "time": "2021-12-08T15:13:44+00:00" + "time": "2022-05-06T14:27:17+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.0.0", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" + "reference": "c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9" }, "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/c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9", + "reference": "c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9", "shasum": "" }, "require": { @@ -1392,7 +1379,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.1" }, "funding": [ { @@ -1408,29 +1395,29 @@ "type": "tidelift" } ], - "time": "2021-09-07T12:43:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "voku/html-min", - "version": "4.4.8", + "version": "4.5.0", "source": { "type": "git", "url": "https://github.com/voku/HtmlMin.git", - "reference": "4f700584abd70b308b7d06b8e4cfcc31711faaf9" + "reference": "2c79e17121bdce16844b1190423bfe0c9537885b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/HtmlMin/zipball/4f700584abd70b308b7d06b8e4cfcc31711faaf9", - "reference": "4f700584abd70b308b7d06b8e4cfcc31711faaf9", + "url": "https://api.github.com/repos/voku/HtmlMin/zipball/2c79e17121bdce16844b1190423bfe0c9537885b", + "reference": "2c79e17121bdce16844b1190423bfe0c9537885b", "shasum": "" }, "require": { "ext-dom": "*", "php": ">=7.0.0", - "voku/simple_html_dom": "~4.7.23" + "voku/simple_html_dom": "~4.8.5" }, "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0" + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" }, "type": "library", "autoload": { @@ -1445,7 +1432,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "HTML Compressor and Minifier", @@ -1459,7 +1446,7 @@ ], "support": { "issues": "https://github.com/voku/HtmlMin/issues", - "source": "https://github.com/voku/HtmlMin/tree/master" + "source": "https://github.com/voku/HtmlMin/tree/4.5.0" }, "funding": [ { @@ -1475,20 +1462,20 @@ "type": "patreon" } ], - "time": "2020-08-11T22:13:23+00:00" + "time": "2022-06-09T07:37:14+00:00" }, { "name": "voku/portable-ascii", - "version": "1.5.6", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "80953678b19901e5165c56752d087fc11526017c" + "reference": "b56450eed252f6801410d810c8e1727224ae0743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", - "reference": "80953678b19901e5165c56752d087fc11526017c", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", "shasum": "" }, "require": { @@ -1525,7 +1512,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" }, "funding": [ { @@ -1549,20 +1536,20 @@ "type": "tidelift" } ], - "time": "2020-11-12T00:07:28+00:00" + "time": "2022-03-08T17:03:00+00:00" }, { "name": "voku/simple_html_dom", - "version": "4.7.30", + "version": "4.8.6", "source": { "type": "git", "url": "https://github.com/voku/simple_html_dom.git", - "reference": "f2be14b8afa7d9a8e5fbc90d93541c23a2134876" + "reference": "1df7e9844eddbe190450c87f281e87bbd8d7f645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/simple_html_dom/zipball/f2be14b8afa7d9a8e5fbc90d93541c23a2134876", - "reference": "f2be14b8afa7d9a8e5fbc90d93541c23a2134876", + "url": "https://api.github.com/repos/voku/simple_html_dom/zipball/1df7e9844eddbe190450c87f281e87bbd8d7f645", + "reference": "1df7e9844eddbe190450c87f281e87bbd8d7f645", "shasum": "" }, "require": { @@ -1570,7 +1557,7 @@ "ext-libxml": "*", "ext-simplexml": "*", "php": ">=7.0.0", - "symfony/css-selector": "~3.0 || ~4.0 || ~5.0" + "symfony/css-selector": "~3.0 || ~4.0 || ~5.0 || ~6.0" }, "require-dev": { "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" @@ -1610,7 +1597,7 @@ ], "support": { "issues": "https://github.com/voku/simple_html_dom/issues", - "source": "https://github.com/voku/simple_html_dom/tree/4.7.30" + "source": "https://github.com/voku/simple_html_dom/tree/4.8.6" }, "funding": [ { @@ -1630,7 +1617,7 @@ "type": "tidelift" } ], - "time": "2021-11-25T05:03:35+00:00" + "time": "2022-06-09T05:48:45+00:00" } ], "packages-dev": [], @@ -1640,8 +1627,8 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.3|^8.0" + "php": "^7.4|^8.0" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/helpers.php b/helpers.php deleted file mode 100644 index 74258f6..0000000 --- a/helpers.php +++ /dev/null @@ -1,14 +0,0 @@ -resolveDisplayableValue(); - } - - if ($value instanceof Htmlable) { - return $value->toHtml(); - } - - return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8', $doubleEncode); -} diff --git a/index.php b/index.php index 88ff7d7..401989b 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,12 @@ use Afbora\Template; use Kirby\Cms\App as Kirby; +// override Kirby `e()` function to use Laravel `e()` function +// if you don't install via composer, you need to define `KIRBY_HELPER_E` from root index.php +if (defined('KIRBY_HELPER_E') === false) { + define('KIRBY_HELPER_E', false); +} + @include_once __DIR__ . '/vendor/autoload.php'; Kirby::plugin('afbora/blade', [ diff --git a/src/View/Compiler/BladeCompiler.php b/src/View/Compiler/BladeCompiler.php index c3eeb53..cd12318 100644 --- a/src/View/Compiler/BladeCompiler.php +++ b/src/View/Compiler/BladeCompiler.php @@ -6,13 +6,6 @@ class BladeCompiler extends Compiler { - /** - * The "regular" / legacy echo string format. - * - * @var string - */ - protected $echoFormat = '_e(%s)'; - /** * Register an "if" statement directive. * @@ -40,24 +33,4 @@ public function if($name, callable $callback) return ''; }); } - - /** - * Set the "echo" format to double encode entities. - * - * @return void - */ - public function withDoubleEncoding() - { - $this->setEchoFormat('_e(%s, true)'); - } - - /** - * Set the "echo" format to not double encode entities. - * - * @return void - */ - public function withoutDoubleEncoding() - { - $this->setEchoFormat('_e(%s, false)'); - } } diff --git a/src/View/Concerns/ManagesLayouts.php b/src/View/Concerns/ManagesLayouts.php deleted file mode 100644 index ebf023d..0000000 --- a/src/View/Concerns/ManagesLayouts.php +++ /dev/null @@ -1,60 +0,0 @@ -sectionStack[] = $section; - } - } else { - $this->extendSection($section, $content instanceof View ? $content : _e($content)); - } - } - - /** - * Get the string contents of a section. - * - * @param string $section - * @param string $default - * @return string - */ - public function yieldContent($section, $default = '') - { - $sectionContent = $default instanceof View ? $default : _e($default); - - if (isset($this->sections[$section])) { - $sectionContent = $this->sections[$section]; - } - - $sectionContent = str_replace('@@parent', '--parent--holder--', $sectionContent); - - return str_replace( - '--parent--holder--', '@parent', str_replace(static::parentPlaceholder($section), '', $sectionContent) - ); - } -} diff --git a/src/View/Factory.php b/src/View/Factory.php deleted file mode 100644 index aa68445..0000000 --- a/src/View/Factory.php +++ /dev/null @@ -1,11 +0,0 @@ -app['blade.compiler']); }); } - - /** - * Create a new Factory Instance. - * - * @param \Illuminate\View\Engines\EngineResolver $resolver - * @param \Illuminate\View\ViewFinderInterface $finder - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return \Afbora\View\Factory - */ - protected function createFactory($resolver, $finder, $events) - { - return new Factory($resolver, $finder, $events); - } } diff --git a/templates/about.blade.php b/templates/about.blade.php deleted file mode 100644 index 34151f1..0000000 --- a/templates/about.blade.php +++ /dev/null @@ -1,51 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-

{{ $page->title() }}

-
- -
- - - -
- {!! $page->text()->kt() !!} -
-
-
-@endsection diff --git a/templates/album.blade.php b/templates/album.blade.php deleted file mode 100644 index 7cc19ed..0000000 --- a/templates/album.blade.php +++ /dev/null @@ -1,33 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-
- @if($cover = $page->cover()) -
- {!! $cover->crop(1024, 768) !!} -
-

{{ $page->headline()->or($page->title()) }}

-
-
- @endif -
-
- {!! $page->description()->kt() !!} - - @if ($page->tags()->isNotEmpty()) -

{{ $page->tags() }}

- @endif -
- -
-
-@endsection diff --git a/templates/default.blade.php b/templates/default.blade.php deleted file mode 100644 index 865c23a..0000000 --- a/templates/default.blade.php +++ /dev/null @@ -1,12 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-

{{ $page->title() }}

-
-
- {!! $page->text()->kt() !!} -
-
-@endsection diff --git a/templates/home.blade.php b/templates/home.blade.php deleted file mode 100644 index 56cc3ed..0000000 --- a/templates/home.blade.php +++ /dev/null @@ -1,17 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-

{{ $site->title() }}

-
- -
    - @foreach (page('photography')->children()->listed() as $album) -
  • - @include("partials.album") -
  • - @endforeach -
-
-@endsection diff --git a/templates/layouts/default.blade.php b/templates/layouts/default.blade.php deleted file mode 100644 index bbd4ef1..0000000 --- a/templates/layouts/default.blade.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - {{ $site->title() }} | {{ $page->title() }} - - {!! css(['assets/css/index.css', '@auto']) !!} - - - - -
-
- - -
- - @yield('content') -
- - - - \ No newline at end of file diff --git a/templates/note.blade.php b/templates/note.blade.php deleted file mode 100644 index 6c9e147..0000000 --- a/templates/note.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-
-

{{ $page->title() }}

- - @if ($page->tags()->isNotEmpty()) -

- {!! $page->tags() !!} -

- @endif -
- -
- {!! $page->text()->kt() !!} -
-
-
-@endsection - - diff --git a/templates/notes.blade.php b/templates/notes.blade.php deleted file mode 100644 index 1731cda..0000000 --- a/templates/notes.blade.php +++ /dev/null @@ -1,14 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-

{{ $page->title() }}

-
-
- @foreach ($page->children()->listed()->sortBy('date', 'desc') as $note) - @include("partials.note") - @endforeach -
-
-@endsection diff --git a/templates/partials/album.blade.php b/templates/partials/album.blade.php deleted file mode 100644 index fd1d6f5..0000000 --- a/templates/partials/album.blade.php +++ /dev/null @@ -1,12 +0,0 @@ - -
- @if($cover = $album->cover()) - {!! $cover->resize(1024, 1024) !!} - @endif -
- - {{ $album->title() }} - -
-
-
\ No newline at end of file diff --git a/templates/partials/image.blade.php b/templates/partials/image.blade.php deleted file mode 100644 index c26549c..0000000 --- a/templates/partials/image.blade.php +++ /dev/null @@ -1,5 +0,0 @@ -
- - {!! $image->crop(800, 1000) !!} - -
\ No newline at end of file diff --git a/templates/partials/note.blade.php b/templates/partials/note.blade.php deleted file mode 100644 index 881587d..0000000 --- a/templates/partials/note.blade.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/templates/partials/photography.blade.php b/templates/partials/photography.blade.php deleted file mode 100644 index 5f27e29..0000000 --- a/templates/partials/photography.blade.php +++ /dev/null @@ -1,8 +0,0 @@ - -
- @if($cover = $album->cover()) - {!! $cover->crop(800, 1000) !!} - @endif -
{{ $album->title() }}
-
-
\ No newline at end of file diff --git a/templates/photography.blade.php b/templates/photography.blade.php deleted file mode 100644 index 11a7cda..0000000 --- a/templates/photography.blade.php +++ /dev/null @@ -1,17 +0,0 @@ -@extends('layouts.default') - -@section('content') -
-
-

{{ $page->title() }}

-
- -
    $page->children()->listed()->isEven()], ' ') }}> - @foreach($page->children()->listed() as $album) -
  • - @include("partials.photography") -
  • - @endforeach -
-
-@endsection diff --git a/vendor/autoload.php b/vendor/autoload.php index 8d70823..19baf09 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,11 @@ // 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); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit0959f47c2681c649b2d705bdf836008d::getLoader(); diff --git a/vendor/bin/carbon b/vendor/bin/carbon index 02f22ab..05f6df2 100644 --- a/vendor/bin/carbon +++ b/vendor/bin/carbon @@ -4,15 +4,16 @@ /** * Proxy PHP file generated by Composer * - * This file includes the referenced bin path (../nesbot/carbon/bin/carbon) using ob_start to remove the shebang if present - * to prevent the shebang from being output on PHP<8 + * This file includes the referenced bin path (../nesbot/carbon/bin/carbon) + * using a stream wrapper to prevent the shebang from being output on PHP<8 * * @generated */ namespace Composer; -$binPath = __DIR__ . "/" . '../nesbot/carbon/bin/carbon'; +$GLOBALS['_composer_bin_dir'] = __DIR__; +$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php'; if (PHP_VERSION_ID < 80000) { if (!class_exists('Composer\BinProxyWrapper')) { @@ -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,33 @@ 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://" . $binPath); + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'); exit(0); } } -include $binPath; +include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'; diff --git a/vendor/bin/carbon.bat b/vendor/bin/carbon.bat index 3cf1f28..806cf15 100644 --- a/vendor/bin/carbon.bat +++ b/vendor/bin/carbon.bat @@ -1,4 +1,5 @@ @ECHO OFF setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../nesbot/carbon/bin/carbon +SET BIN_TARGET=%~dp0/carbon +SET COMPOSER_RUNTIME_BIN_DIR=%~dp0 php "%BIN_TARGET%" %* diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 0cd6055..afef3fa 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -149,7 +149,7 @@ public function getFallbackDirsPsr4() /** * @return string[] Array of classname => path - * @psalm-var array + * @psalm-return array */ public function getClassMap() { diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index d50e0c9..c6b54af 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -21,12 +21,14 @@ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; @@ -37,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -241,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -255,7 +257,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -278,7 +280,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -301,7 +303,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -311,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index af47990..4977efc 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,15 +2,13 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Afbora\\Blade\\Blade' => $baseDir . '/src/Blade/Blade.php', 'Afbora\\Template' => $baseDir . '/src/Template.php', 'Afbora\\View\\Compiler\\BladeCompiler' => $baseDir . '/src/View/Compiler/BladeCompiler.php', - 'Afbora\\View\\Concerns\\ManagesLayouts' => $baseDir . '/src/View/Concerns/ManagesLayouts.php', - 'Afbora\\View\\Factory' => $baseDir . '/src/View/Factory.php', 'Afbora\\View\\ViewServiceProvider' => $baseDir . '/src/View/ViewServiceProvider.php', 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Carbon\\AbstractTranslator' => $vendorDir . '/nesbot/carbon/src/Carbon/AbstractTranslator.php', @@ -61,6 +59,7 @@ 'Carbon\\FactoryImmutable' => $vendorDir . '/nesbot/carbon/src/Carbon/FactoryImmutable.php', 'Carbon\\Language' => $vendorDir . '/nesbot/carbon/src/Carbon/Language.php', 'Carbon\\Laravel\\ServiceProvider' => $vendorDir . '/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php', + 'Carbon\\PHPStan\\AbstractMacro' => $vendorDir . '/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php', 'Carbon\\PHPStan\\Macro' => $vendorDir . '/nesbot/carbon/src/Carbon/PHPStan/Macro.php', 'Carbon\\PHPStan\\MacroExtension' => $vendorDir . '/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php', 'Carbon\\PHPStan\\MacroScanner' => $vendorDir . '/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php', @@ -88,6 +87,7 @@ 'Carbon\\Traits\\Units' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/Units.php', 'Carbon\\Traits\\Week' => $vendorDir . '/nesbot/carbon/src/Carbon/Traits/Week.php', 'Carbon\\Translator' => $vendorDir . '/nesbot/carbon/src/Carbon/Translator.php', + 'Carbon\\TranslatorImmutable' => $vendorDir . '/nesbot/carbon/src/Carbon/TranslatorImmutable.php', 'Carbon\\TranslatorStrongTypeInterface' => $vendorDir . '/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Doctrine\\Inflector\\CachedWordInflector' => $vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php', @@ -185,6 +185,7 @@ 'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => $vendorDir . '/illuminate/contracts/Container/ContextualBindingBuilder.php', 'Illuminate\\Contracts\\Cookie\\Factory' => $vendorDir . '/illuminate/contracts/Cookie/Factory.php', 'Illuminate\\Contracts\\Cookie\\QueueingFactory' => $vendorDir . '/illuminate/contracts/Cookie/QueueingFactory.php', + 'Illuminate\\Contracts\\Database\\Eloquent\\Builder' => $vendorDir . '/illuminate/contracts/Database/Eloquent/Builder.php', 'Illuminate\\Contracts\\Database\\Eloquent\\Castable' => $vendorDir . '/illuminate/contracts/Database/Eloquent/Castable.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/CastsAttributes.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsInboundAttributes' => $vendorDir . '/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php', @@ -193,6 +194,7 @@ 'Illuminate\\Contracts\\Database\\Eloquent\\SupportsPartialRelations' => $vendorDir . '/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php', 'Illuminate\\Contracts\\Database\\Events\\MigrationEvent' => $vendorDir . '/illuminate/contracts/Database/Events/MigrationEvent.php', 'Illuminate\\Contracts\\Database\\ModelIdentifier' => $vendorDir . '/illuminate/contracts/Database/ModelIdentifier.php', + 'Illuminate\\Contracts\\Database\\Query\\Builder' => $vendorDir . '/illuminate/contracts/Database/Query/Builder.php', 'Illuminate\\Contracts\\Debug\\ExceptionHandler' => $vendorDir . '/illuminate/contracts/Debug/ExceptionHandler.php', 'Illuminate\\Contracts\\Encryption\\DecryptException' => $vendorDir . '/illuminate/contracts/Encryption/DecryptException.php', 'Illuminate\\Contracts\\Encryption\\EncryptException' => $vendorDir . '/illuminate/contracts/Encryption/EncryptException.php', @@ -201,15 +203,17 @@ 'Illuminate\\Contracts\\Events\\Dispatcher' => $vendorDir . '/illuminate/contracts/Events/Dispatcher.php', 'Illuminate\\Contracts\\Filesystem\\Cloud' => $vendorDir . '/illuminate/contracts/Filesystem/Cloud.php', 'Illuminate\\Contracts\\Filesystem\\Factory' => $vendorDir . '/illuminate/contracts/Filesystem/Factory.php', - 'Illuminate\\Contracts\\Filesystem\\FileExistsException' => $vendorDir . '/illuminate/contracts/Filesystem/FileExistsException.php', 'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => $vendorDir . '/illuminate/contracts/Filesystem/FileNotFoundException.php', 'Illuminate\\Contracts\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/contracts/Filesystem/Filesystem.php', 'Illuminate\\Contracts\\Filesystem\\LockTimeoutException' => $vendorDir . '/illuminate/contracts/Filesystem/LockTimeoutException.php', 'Illuminate\\Contracts\\Foundation\\Application' => $vendorDir . '/illuminate/contracts/Foundation/Application.php', 'Illuminate\\Contracts\\Foundation\\CachesConfiguration' => $vendorDir . '/illuminate/contracts/Foundation/CachesConfiguration.php', 'Illuminate\\Contracts\\Foundation\\CachesRoutes' => $vendorDir . '/illuminate/contracts/Foundation/CachesRoutes.php', + 'Illuminate\\Contracts\\Foundation\\ExceptionRenderer' => $vendorDir . '/illuminate/contracts/Foundation/ExceptionRenderer.php', + 'Illuminate\\Contracts\\Foundation\\MaintenanceMode' => $vendorDir . '/illuminate/contracts/Foundation/MaintenanceMode.php', 'Illuminate\\Contracts\\Hashing\\Hasher' => $vendorDir . '/illuminate/contracts/Hashing/Hasher.php', 'Illuminate\\Contracts\\Http\\Kernel' => $vendorDir . '/illuminate/contracts/Http/Kernel.php', + 'Illuminate\\Contracts\\Mail\\Attachable' => $vendorDir . '/illuminate/contracts/Mail/Attachable.php', 'Illuminate\\Contracts\\Mail\\Factory' => $vendorDir . '/illuminate/contracts/Mail/Factory.php', 'Illuminate\\Contracts\\Mail\\MailQueue' => $vendorDir . '/illuminate/contracts/Mail/MailQueue.php', 'Illuminate\\Contracts\\Mail\\Mailable' => $vendorDir . '/illuminate/contracts/Mail/Mailable.php', @@ -243,6 +247,7 @@ 'Illuminate\\Contracts\\Routing\\ResponseFactory' => $vendorDir . '/illuminate/contracts/Routing/ResponseFactory.php', 'Illuminate\\Contracts\\Routing\\UrlGenerator' => $vendorDir . '/illuminate/contracts/Routing/UrlGenerator.php', 'Illuminate\\Contracts\\Routing\\UrlRoutable' => $vendorDir . '/illuminate/contracts/Routing/UrlRoutable.php', + 'Illuminate\\Contracts\\Session\\Middleware\\AuthenticatesSessions' => $vendorDir . '/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php', 'Illuminate\\Contracts\\Session\\Session' => $vendorDir . '/illuminate/contracts/Session/Session.php', 'Illuminate\\Contracts\\Support\\Arrayable' => $vendorDir . '/illuminate/contracts/Support/Arrayable.php', 'Illuminate\\Contracts\\Support\\CanBeEscapedWhenCastToString' => $vendorDir . '/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php', @@ -261,6 +266,7 @@ 'Illuminate\\Contracts\\Validation\\DataAwareRule' => $vendorDir . '/illuminate/contracts/Validation/DataAwareRule.php', 'Illuminate\\Contracts\\Validation\\Factory' => $vendorDir . '/illuminate/contracts/Validation/Factory.php', 'Illuminate\\Contracts\\Validation\\ImplicitRule' => $vendorDir . '/illuminate/contracts/Validation/ImplicitRule.php', + 'Illuminate\\Contracts\\Validation\\InvokableRule' => $vendorDir . '/illuminate/contracts/Validation/InvokableRule.php', 'Illuminate\\Contracts\\Validation\\Rule' => $vendorDir . '/illuminate/contracts/Validation/Rule.php', 'Illuminate\\Contracts\\Validation\\UncompromisedVerifier' => $vendorDir . '/illuminate/contracts/Validation/UncompromisedVerifier.php', 'Illuminate\\Contracts\\Validation\\ValidatesWhenResolved' => $vendorDir . '/illuminate/contracts/Validation/ValidatesWhenResolved.php', @@ -275,7 +281,7 @@ 'Illuminate\\Events\\InvokeQueuedClosure' => $vendorDir . '/illuminate/events/InvokeQueuedClosure.php', 'Illuminate\\Events\\NullDispatcher' => $vendorDir . '/illuminate/events/NullDispatcher.php', 'Illuminate\\Events\\QueuedClosure' => $vendorDir . '/illuminate/events/QueuedClosure.php', - 'Illuminate\\Filesystem\\Cache' => $vendorDir . '/illuminate/filesystem/Cache.php', + 'Illuminate\\Filesystem\\AwsS3V3Adapter' => $vendorDir . '/illuminate/filesystem/AwsS3V3Adapter.php', 'Illuminate\\Filesystem\\Filesystem' => $vendorDir . '/illuminate/filesystem/Filesystem.php', 'Illuminate\\Filesystem\\FilesystemAdapter' => $vendorDir . '/illuminate/filesystem/FilesystemAdapter.php', 'Illuminate\\Filesystem\\FilesystemManager' => $vendorDir . '/illuminate/filesystem/FilesystemManager.php', @@ -333,7 +339,7 @@ 'Illuminate\\Support\\Fluent' => $vendorDir . '/illuminate/support/Fluent.php', 'Illuminate\\Support\\HigherOrderCollectionProxy' => $vendorDir . '/illuminate/collections/HigherOrderCollectionProxy.php', 'Illuminate\\Support\\HigherOrderTapProxy' => $vendorDir . '/illuminate/support/HigherOrderTapProxy.php', - 'Illuminate\\Support\\HigherOrderWhenProxy' => $vendorDir . '/illuminate/collections/HigherOrderWhenProxy.php', + 'Illuminate\\Support\\HigherOrderWhenProxy' => $vendorDir . '/illuminate/conditionable/HigherOrderWhenProxy.php', 'Illuminate\\Support\\HtmlString' => $vendorDir . '/illuminate/support/HtmlString.php', 'Illuminate\\Support\\InteractsWithTime' => $vendorDir . '/illuminate/support/InteractsWithTime.php', 'Illuminate\\Support\\ItemNotFoundException' => $vendorDir . '/illuminate/collections/ItemNotFoundException.php', @@ -341,6 +347,7 @@ 'Illuminate\\Support\\LazyCollection' => $vendorDir . '/illuminate/collections/LazyCollection.php', 'Illuminate\\Support\\Manager' => $vendorDir . '/illuminate/support/Manager.php', 'Illuminate\\Support\\MessageBag' => $vendorDir . '/illuminate/support/MessageBag.php', + 'Illuminate\\Support\\MultipleInstanceManager' => $vendorDir . '/illuminate/support/MultipleInstanceManager.php', 'Illuminate\\Support\\MultipleItemsFoundException' => $vendorDir . '/illuminate/collections/MultipleItemsFoundException.php', 'Illuminate\\Support\\NamespacedItemResolver' => $vendorDir . '/illuminate/support/NamespacedItemResolver.php', 'Illuminate\\Support\\Optional' => $vendorDir . '/illuminate/support/Optional.php', @@ -360,7 +367,7 @@ 'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => $vendorDir . '/illuminate/support/Testing/Fakes/PendingMailFake.php', 'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => $vendorDir . '/illuminate/support/Testing/Fakes/QueueFake.php', 'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => $vendorDir . '/illuminate/support/Traits/CapsuleManagerTrait.php', - 'Illuminate\\Support\\Traits\\Conditionable' => $vendorDir . '/illuminate/support/Traits/Conditionable.php', + 'Illuminate\\Support\\Traits\\Conditionable' => $vendorDir . '/illuminate/conditionable/Traits/Conditionable.php', 'Illuminate\\Support\\Traits\\EnumeratesValues' => $vendorDir . '/illuminate/collections/Traits/EnumeratesValues.php', 'Illuminate\\Support\\Traits\\ForwardsCalls' => $vendorDir . '/illuminate/support/Traits/ForwardsCalls.php', 'Illuminate\\Support\\Traits\\Localizable' => $vendorDir . '/illuminate/support/Traits/Localizable.php', @@ -420,6 +427,7 @@ 'Kirby\\ComposerInstaller\\Installer' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php', 'Kirby\\ComposerInstaller\\Plugin' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php', 'Kirby\\ComposerInstaller\\PluginInstaller' => $vendorDir . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php', 'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php', 'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php', @@ -592,6 +600,7 @@ 'Symfony\\Contracts\\Translation\\TranslatorTrait' => $vendorDir . '/symfony/translation-contracts/TranslatorTrait.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => $vendorDir . '/symfony/polyfill-mbstring/Mbstring.php', 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', + 'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php', 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 'voku\\helper\\ASCII' => $vendorDir . '/voku/portable-ascii/src/voku/helper/ASCII.php', @@ -601,6 +610,7 @@ 'voku\\helper\\AbstractSimpleXmlDom' => $vendorDir . '/voku/simple_html_dom/src/voku/helper/AbstractSimpleXmlDom.php', 'voku\\helper\\AbstractSimpleXmlDomNode' => $vendorDir . '/voku/simple_html_dom/src/voku/helper/AbstractSimpleXmlDomNode.php', 'voku\\helper\\DomParserInterface' => $vendorDir . '/voku/simple_html_dom/src/voku/helper/DomParserInterface.php', + 'voku\\helper\\HtmlDomHelper' => $vendorDir . '/voku/simple_html_dom/src/voku/helper/HtmlDomHelper.php', 'voku\\helper\\HtmlDomParser' => $vendorDir . '/voku/simple_html_dom/src/voku/helper/HtmlDomParser.php', 'voku\\helper\\HtmlMin' => $vendorDir . '/voku/html-min/src/voku/helper/HtmlMin.php', 'voku\\helper\\HtmlMinDomObserverInterface' => $vendorDir . '/voku/html-min/src/voku/helper/HtmlMinDomObserverInterface.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index d236bb7..734ed3f 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,16 +2,14 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php', 'ef65a1626449d89d0811cf9befce46f0' => $vendorDir . '/illuminate/events/functions.php', - 'c7670cb7f1849ee3cda73e84aedf83f0' => $baseDir . '/helpers.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index e0d9c39..737984d 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -18,7 +18,7 @@ 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Kirby\\' => array($vendorDir . '/getkirby/composer-installer/src'), 'Illuminate\\View\\' => array($vendorDir . '/illuminate/view'), - 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'), + 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/support'), 'Illuminate\\Pipeline\\' => array($vendorDir . '/illuminate/pipeline'), 'Illuminate\\Filesystem\\' => array($vendorDir . '/illuminate/filesystem'), 'Illuminate\\Events\\' => array($vendorDir . '/illuminate/events'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 0e1e598..bbf8118 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -25,38 +25,15 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit0959f47c2681c649b2d705bdf836008d', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit0959f47c2681c649b2d705bdf836008d', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit0959f47c2681c649b2d705bdf836008d::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit0959f47c2681c649b2d705bdf836008d::getInitializer($loader)); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit0959f47c2681c649b2d705bdf836008d::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } + $includeFiles = \Composer\Autoload\ComposerStaticInit0959f47c2681c649b2d705bdf836008d::$files; foreach ($includeFiles as $fileIdentifier => $file) { composerRequire0959f47c2681c649b2d705bdf836008d($fileIdentifier, $file); } @@ -65,11 +42,16 @@ public static function getLoader() } } +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ function composerRequire0959f47c2681c649b2d705bdf836008d($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; } } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 09d4fb8..1212ac3 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -7,14 +7,12 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d { public static $files = array ( - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', 'ef65a1626449d89d0811cf9befce46f0' => __DIR__ . '/..' . '/illuminate/events/functions.php', - 'c7670cb7f1849ee3cda73e84aedf83f0' => __DIR__ . '/../..' . '/helpers.php', ); public static $prefixLengthsPsr4 = array ( @@ -118,9 +116,10 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d ), 'Illuminate\\Support\\' => array ( - 0 => __DIR__ . '/..' . '/illuminate/macroable', - 1 => __DIR__ . '/..' . '/illuminate/collections', - 2 => __DIR__ . '/..' . '/illuminate/support', + 0 => __DIR__ . '/..' . '/illuminate/collections', + 1 => __DIR__ . '/..' . '/illuminate/conditionable', + 2 => __DIR__ . '/..' . '/illuminate/macroable', + 3 => __DIR__ . '/..' . '/illuminate/support', ), 'Illuminate\\Pipeline\\' => array ( @@ -164,8 +163,6 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Afbora\\Blade\\Blade' => __DIR__ . '/../..' . '/src/Blade/Blade.php', 'Afbora\\Template' => __DIR__ . '/../..' . '/src/Template.php', 'Afbora\\View\\Compiler\\BladeCompiler' => __DIR__ . '/../..' . '/src/View/Compiler/BladeCompiler.php', - 'Afbora\\View\\Concerns\\ManagesLayouts' => __DIR__ . '/../..' . '/src/View/Concerns/ManagesLayouts.php', - 'Afbora\\View\\Factory' => __DIR__ . '/../..' . '/src/View/Factory.php', 'Afbora\\View\\ViewServiceProvider' => __DIR__ . '/../..' . '/src/View/ViewServiceProvider.php', 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Carbon\\AbstractTranslator' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/AbstractTranslator.php', @@ -216,6 +213,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Carbon\\FactoryImmutable' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/FactoryImmutable.php', 'Carbon\\Language' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Language.php', 'Carbon\\Laravel\\ServiceProvider' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php', + 'Carbon\\PHPStan\\AbstractMacro' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php', 'Carbon\\PHPStan\\Macro' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/PHPStan/Macro.php', 'Carbon\\PHPStan\\MacroExtension' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php', 'Carbon\\PHPStan\\MacroScanner' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/PHPStan/MacroScanner.php', @@ -243,6 +241,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Carbon\\Traits\\Units' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/Units.php', 'Carbon\\Traits\\Week' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Traits/Week.php', 'Carbon\\Translator' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Translator.php', + 'Carbon\\TranslatorImmutable' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/TranslatorImmutable.php', 'Carbon\\TranslatorStrongTypeInterface' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'Doctrine\\Inflector\\CachedWordInflector' => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector/CachedWordInflector.php', @@ -340,6 +339,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Contracts\\Container\\ContextualBindingBuilder' => __DIR__ . '/..' . '/illuminate/contracts/Container/ContextualBindingBuilder.php', 'Illuminate\\Contracts\\Cookie\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/Factory.php', 'Illuminate\\Contracts\\Cookie\\QueueingFactory' => __DIR__ . '/..' . '/illuminate/contracts/Cookie/QueueingFactory.php', + 'Illuminate\\Contracts\\Database\\Eloquent\\Builder' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/Builder.php', 'Illuminate\\Contracts\\Database\\Eloquent\\Castable' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/Castable.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/CastsAttributes.php', 'Illuminate\\Contracts\\Database\\Eloquent\\CastsInboundAttributes' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php', @@ -348,6 +348,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Contracts\\Database\\Eloquent\\SupportsPartialRelations' => __DIR__ . '/..' . '/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php', 'Illuminate\\Contracts\\Database\\Events\\MigrationEvent' => __DIR__ . '/..' . '/illuminate/contracts/Database/Events/MigrationEvent.php', 'Illuminate\\Contracts\\Database\\ModelIdentifier' => __DIR__ . '/..' . '/illuminate/contracts/Database/ModelIdentifier.php', + 'Illuminate\\Contracts\\Database\\Query\\Builder' => __DIR__ . '/..' . '/illuminate/contracts/Database/Query/Builder.php', 'Illuminate\\Contracts\\Debug\\ExceptionHandler' => __DIR__ . '/..' . '/illuminate/contracts/Debug/ExceptionHandler.php', 'Illuminate\\Contracts\\Encryption\\DecryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/DecryptException.php', 'Illuminate\\Contracts\\Encryption\\EncryptException' => __DIR__ . '/..' . '/illuminate/contracts/Encryption/EncryptException.php', @@ -356,15 +357,17 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Contracts\\Events\\Dispatcher' => __DIR__ . '/..' . '/illuminate/contracts/Events/Dispatcher.php', 'Illuminate\\Contracts\\Filesystem\\Cloud' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Cloud.php', 'Illuminate\\Contracts\\Filesystem\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Factory.php', - 'Illuminate\\Contracts\\Filesystem\\FileExistsException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileExistsException.php', 'Illuminate\\Contracts\\Filesystem\\FileNotFoundException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/FileNotFoundException.php', 'Illuminate\\Contracts\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/Filesystem.php', 'Illuminate\\Contracts\\Filesystem\\LockTimeoutException' => __DIR__ . '/..' . '/illuminate/contracts/Filesystem/LockTimeoutException.php', 'Illuminate\\Contracts\\Foundation\\Application' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/Application.php', 'Illuminate\\Contracts\\Foundation\\CachesConfiguration' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/CachesConfiguration.php', 'Illuminate\\Contracts\\Foundation\\CachesRoutes' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/CachesRoutes.php', + 'Illuminate\\Contracts\\Foundation\\ExceptionRenderer' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/ExceptionRenderer.php', + 'Illuminate\\Contracts\\Foundation\\MaintenanceMode' => __DIR__ . '/..' . '/illuminate/contracts/Foundation/MaintenanceMode.php', 'Illuminate\\Contracts\\Hashing\\Hasher' => __DIR__ . '/..' . '/illuminate/contracts/Hashing/Hasher.php', 'Illuminate\\Contracts\\Http\\Kernel' => __DIR__ . '/..' . '/illuminate/contracts/Http/Kernel.php', + 'Illuminate\\Contracts\\Mail\\Attachable' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Attachable.php', 'Illuminate\\Contracts\\Mail\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Factory.php', 'Illuminate\\Contracts\\Mail\\MailQueue' => __DIR__ . '/..' . '/illuminate/contracts/Mail/MailQueue.php', 'Illuminate\\Contracts\\Mail\\Mailable' => __DIR__ . '/..' . '/illuminate/contracts/Mail/Mailable.php', @@ -398,6 +401,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Contracts\\Routing\\ResponseFactory' => __DIR__ . '/..' . '/illuminate/contracts/Routing/ResponseFactory.php', 'Illuminate\\Contracts\\Routing\\UrlGenerator' => __DIR__ . '/..' . '/illuminate/contracts/Routing/UrlGenerator.php', 'Illuminate\\Contracts\\Routing\\UrlRoutable' => __DIR__ . '/..' . '/illuminate/contracts/Routing/UrlRoutable.php', + 'Illuminate\\Contracts\\Session\\Middleware\\AuthenticatesSessions' => __DIR__ . '/..' . '/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php', 'Illuminate\\Contracts\\Session\\Session' => __DIR__ . '/..' . '/illuminate/contracts/Session/Session.php', 'Illuminate\\Contracts\\Support\\Arrayable' => __DIR__ . '/..' . '/illuminate/contracts/Support/Arrayable.php', 'Illuminate\\Contracts\\Support\\CanBeEscapedWhenCastToString' => __DIR__ . '/..' . '/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php', @@ -416,6 +420,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Contracts\\Validation\\DataAwareRule' => __DIR__ . '/..' . '/illuminate/contracts/Validation/DataAwareRule.php', 'Illuminate\\Contracts\\Validation\\Factory' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Factory.php', 'Illuminate\\Contracts\\Validation\\ImplicitRule' => __DIR__ . '/..' . '/illuminate/contracts/Validation/ImplicitRule.php', + 'Illuminate\\Contracts\\Validation\\InvokableRule' => __DIR__ . '/..' . '/illuminate/contracts/Validation/InvokableRule.php', 'Illuminate\\Contracts\\Validation\\Rule' => __DIR__ . '/..' . '/illuminate/contracts/Validation/Rule.php', 'Illuminate\\Contracts\\Validation\\UncompromisedVerifier' => __DIR__ . '/..' . '/illuminate/contracts/Validation/UncompromisedVerifier.php', 'Illuminate\\Contracts\\Validation\\ValidatesWhenResolved' => __DIR__ . '/..' . '/illuminate/contracts/Validation/ValidatesWhenResolved.php', @@ -430,7 +435,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Events\\InvokeQueuedClosure' => __DIR__ . '/..' . '/illuminate/events/InvokeQueuedClosure.php', 'Illuminate\\Events\\NullDispatcher' => __DIR__ . '/..' . '/illuminate/events/NullDispatcher.php', 'Illuminate\\Events\\QueuedClosure' => __DIR__ . '/..' . '/illuminate/events/QueuedClosure.php', - 'Illuminate\\Filesystem\\Cache' => __DIR__ . '/..' . '/illuminate/filesystem/Cache.php', + 'Illuminate\\Filesystem\\AwsS3V3Adapter' => __DIR__ . '/..' . '/illuminate/filesystem/AwsS3V3Adapter.php', 'Illuminate\\Filesystem\\Filesystem' => __DIR__ . '/..' . '/illuminate/filesystem/Filesystem.php', 'Illuminate\\Filesystem\\FilesystemAdapter' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemAdapter.php', 'Illuminate\\Filesystem\\FilesystemManager' => __DIR__ . '/..' . '/illuminate/filesystem/FilesystemManager.php', @@ -488,7 +493,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Support\\Fluent' => __DIR__ . '/..' . '/illuminate/support/Fluent.php', 'Illuminate\\Support\\HigherOrderCollectionProxy' => __DIR__ . '/..' . '/illuminate/collections/HigherOrderCollectionProxy.php', 'Illuminate\\Support\\HigherOrderTapProxy' => __DIR__ . '/..' . '/illuminate/support/HigherOrderTapProxy.php', - 'Illuminate\\Support\\HigherOrderWhenProxy' => __DIR__ . '/..' . '/illuminate/collections/HigherOrderWhenProxy.php', + 'Illuminate\\Support\\HigherOrderWhenProxy' => __DIR__ . '/..' . '/illuminate/conditionable/HigherOrderWhenProxy.php', 'Illuminate\\Support\\HtmlString' => __DIR__ . '/..' . '/illuminate/support/HtmlString.php', 'Illuminate\\Support\\InteractsWithTime' => __DIR__ . '/..' . '/illuminate/support/InteractsWithTime.php', 'Illuminate\\Support\\ItemNotFoundException' => __DIR__ . '/..' . '/illuminate/collections/ItemNotFoundException.php', @@ -496,6 +501,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Support\\LazyCollection' => __DIR__ . '/..' . '/illuminate/collections/LazyCollection.php', 'Illuminate\\Support\\Manager' => __DIR__ . '/..' . '/illuminate/support/Manager.php', 'Illuminate\\Support\\MessageBag' => __DIR__ . '/..' . '/illuminate/support/MessageBag.php', + 'Illuminate\\Support\\MultipleInstanceManager' => __DIR__ . '/..' . '/illuminate/support/MultipleInstanceManager.php', 'Illuminate\\Support\\MultipleItemsFoundException' => __DIR__ . '/..' . '/illuminate/collections/MultipleItemsFoundException.php', 'Illuminate\\Support\\NamespacedItemResolver' => __DIR__ . '/..' . '/illuminate/support/NamespacedItemResolver.php', 'Illuminate\\Support\\Optional' => __DIR__ . '/..' . '/illuminate/support/Optional.php', @@ -515,7 +521,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Illuminate\\Support\\Testing\\Fakes\\PendingMailFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/PendingMailFake.php', 'Illuminate\\Support\\Testing\\Fakes\\QueueFake' => __DIR__ . '/..' . '/illuminate/support/Testing/Fakes/QueueFake.php', 'Illuminate\\Support\\Traits\\CapsuleManagerTrait' => __DIR__ . '/..' . '/illuminate/support/Traits/CapsuleManagerTrait.php', - 'Illuminate\\Support\\Traits\\Conditionable' => __DIR__ . '/..' . '/illuminate/support/Traits/Conditionable.php', + 'Illuminate\\Support\\Traits\\Conditionable' => __DIR__ . '/..' . '/illuminate/conditionable/Traits/Conditionable.php', 'Illuminate\\Support\\Traits\\EnumeratesValues' => __DIR__ . '/..' . '/illuminate/collections/Traits/EnumeratesValues.php', 'Illuminate\\Support\\Traits\\ForwardsCalls' => __DIR__ . '/..' . '/illuminate/support/Traits/ForwardsCalls.php', 'Illuminate\\Support\\Traits\\Localizable' => __DIR__ . '/..' . '/illuminate/support/Traits/Localizable.php', @@ -575,6 +581,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Kirby\\ComposerInstaller\\Installer' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Installer.php', 'Kirby\\ComposerInstaller\\Plugin' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/Plugin.php', 'Kirby\\ComposerInstaller\\PluginInstaller' => __DIR__ . '/..' . '/getkirby/composer-installer/src/ComposerInstaller/PluginInstaller.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php', 'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php', 'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php', @@ -747,6 +754,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'Symfony\\Contracts\\Translation\\TranslatorTrait' => __DIR__ . '/..' . '/symfony/translation-contracts/TranslatorTrait.php', 'Symfony\\Polyfill\\Mbstring\\Mbstring' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/Mbstring.php', 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', + 'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php', 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 'voku\\helper\\ASCII' => __DIR__ . '/..' . '/voku/portable-ascii/src/voku/helper/ASCII.php', @@ -756,6 +764,7 @@ class ComposerStaticInit0959f47c2681c649b2d705bdf836008d 'voku\\helper\\AbstractSimpleXmlDom' => __DIR__ . '/..' . '/voku/simple_html_dom/src/voku/helper/AbstractSimpleXmlDom.php', 'voku\\helper\\AbstractSimpleXmlDomNode' => __DIR__ . '/..' . '/voku/simple_html_dom/src/voku/helper/AbstractSimpleXmlDomNode.php', 'voku\\helper\\DomParserInterface' => __DIR__ . '/..' . '/voku/simple_html_dom/src/voku/helper/DomParserInterface.php', + 'voku\\helper\\HtmlDomHelper' => __DIR__ . '/..' . '/voku/simple_html_dom/src/voku/helper/HtmlDomHelper.php', 'voku\\helper\\HtmlDomParser' => __DIR__ . '/..' . '/voku/simple_html_dom/src/voku/helper/HtmlDomParser.php', 'voku\\helper\\HtmlMin' => __DIR__ . '/..' . '/voku/html-min/src/voku/helper/HtmlMin.php', 'voku\\helper\\HtmlMinDomObserverInterface' => __DIR__ . '/..' . '/voku/html-min/src/voku/helper/HtmlMinDomObserverInterface.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 0082b5b..f761406 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -146,34 +146,34 @@ }, { "name": "illuminate/bus", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/bus.git", - "reference": "82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0" + "reference": "14060207ad684e6ea29b9ff3f349813d1d2a2a0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/bus/zipball/82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0", - "reference": "82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0", + "url": "https://api.github.com/repos/illuminate/bus/zipball/14060207ad684e6ea29b9ff3f349813d1d2a2a0a", + "reference": "14060207ad684e6ea29b9ff3f349813d1d2a2a0a", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/pipeline": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/pipeline": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" }, "suggest": { "illuminate/queue": "Required to use closures when chaining jobs (^7.0)." }, - "time": "2021-11-23T19:43:42+00:00", + "time": "2022-06-15T06:56:01+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -202,42 +202,43 @@ }, { "name": "illuminate/collections", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "5a018387352afa2af30fd2be0a78c31e93295720" + "reference": "239c9274b8008fb9532ada0899365d1e182f8f9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/5a018387352afa2af30fd2be0a78c31e93295720", - "reference": "5a018387352afa2af30fd2be0a78c31e93295720", + "url": "https://api.github.com/repos/illuminate/collections/zipball/239c9274b8008fb9532ada0899365d1e182f8f9d", + "reference": "239c9274b8008fb9532ada0899365d1e182f8f9d", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "php": "^7.3|^8.0" + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "php": "^8.0.2" }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, - "time": "2021-12-07T14:48:29+00:00", + "time": "2022-06-19T21:41:21+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -257,34 +258,83 @@ }, "install-path": "../illuminate/collections" }, + { + "name": "illuminate/conditionable", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/conditionable.git", + "reference": "46b7beed47948bd2e67f523d0a76daa62775031e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/46b7beed47948bd2e67f523d0a76daa62775031e", + "reference": "46b7beed47948bd2e67f523d0a76daa62775031e", + "shasum": "" + }, + "require": { + "php": "^8.0.2" + }, + "time": "2022-05-31T14:47:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Conditionable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/conditionable" + }, { "name": "illuminate/container", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "6ac391bb27391706c5f921b85060aa2c4ca03fae" + "reference": "d86b073cae04713cf28def54417fa771621bc4f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/6ac391bb27391706c5f921b85060aa2c4ca03fae", - "reference": "6ac391bb27391706c5f921b85060aa2c4ca03fae", + "url": "https://api.github.com/repos/illuminate/container/zipball/d86b073cae04713cf28def54417fa771621bc4f1", + "reference": "d86b073cae04713cf28def54417fa771621bc4f1", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "php": "^7.3|^8.0", - "psr/container": "^1.0" + "illuminate/contracts": "^9.0", + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.1|2.0" }, - "time": "2021-11-17T15:04:30+00:00", + "time": "2022-05-16T15:53:09+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -313,29 +363,29 @@ }, { "name": "illuminate/contracts", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f" + "reference": "e014cf88ef46065b8b1f078893c01189b95ffb11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f", - "reference": "b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/e014cf88ef46065b8b1f078893c01189b95ffb11", + "reference": "e014cf88ef46065b8b1f078893c01189b95ffb11", "shasum": "" }, "require": { - "php": "^7.3|^8.0", - "psr/container": "^1.0", - "psr/simple-cache": "^1.0" + "php": "^8.0.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" }, - "time": "2021-12-07T08:18:44+00:00", + "time": "2022-06-07T19:28:00+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -364,43 +414,43 @@ }, { "name": "illuminate/events", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/events.git", - "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d" + "reference": "2dea521665d295f6cefef78f1b5abeea6b94e35f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/events/zipball/b7f06cafb6c09581617f2ca05d69e9b159e5a35d", - "reference": "b7f06cafb6c09581617f2ca05d69e9b159e5a35d", + "url": "https://api.github.com/repos/illuminate/events/zipball/2dea521665d295f6cefef78f1b5abeea6b94e35f", + "reference": "2dea521665d295f6cefef78f1b5abeea6b94e35f", "shasum": "" }, "require": { - "illuminate/bus": "^8.0", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" - }, - "time": "2021-09-15T14:32:50+00:00", + "illuminate/bus": "^9.0", + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" + }, + "time": "2022-05-02T13:59:45+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Illuminate\\Events\\": "" - }, "files": [ "functions.php" - ] + ], + "psr-4": { + "Illuminate\\Events\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -422,43 +472,43 @@ }, { "name": "illuminate/filesystem", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf" + "reference": "0a73863f90e905d1d5053108fa2a270b2ec6fb0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf", - "reference": "b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/0a73863f90e905d1d5053108fa2a270b2ec6fb0f", + "reference": "0a73863f90e905d1d5053108fa2a270b2ec6fb0f", "shasum": "" }, "require": { - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "symfony/finder": "^5.4" + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2", + "symfony/finder": "^6.0" }, "suggest": { "ext-ftp": "Required to use the Flysystem FTP driver.", "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", + "league/flysystem": "Required to use the Flysystem local driver (^3.0.16).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", - "symfony/mime": "Required to enable support for guessing extensions (^5.4)." + "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", + "symfony/mime": "Required to enable support for guessing extensions (^6.0)." }, - "time": "2021-11-30T14:13:40+00:00", + "time": "2022-06-20T16:41:48+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -487,27 +537,27 @@ }, { "name": "illuminate/macroable", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", - "reference": "aed81891a6e046fdee72edd497f822190f61c162" + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", - "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/25a2c6dac2b7541ecbadef952702e84ae15f5354", + "reference": "25a2c6dac2b7541ecbadef952702e84ae15f5354", "shasum": "" }, "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, - "time": "2021-11-16T13:57:03+00:00", + "time": "2022-02-01T14:44:21+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -536,29 +586,29 @@ }, { "name": "illuminate/pipeline", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/pipeline.git", - "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2" + "reference": "e0be3f3f79f8235ad7334919ca4094d5074e02f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/pipeline/zipball/23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", - "reference": "23aeff5b26ae4aee3f370835c76bd0f4e93f71d2", + "url": "https://api.github.com/repos/illuminate/pipeline/zipball/e0be3f3f79f8235ad7334919ca4094d5074e02f6", + "reference": "e0be3f3f79f8235ad7334919ca4094d5074e02f6", "shasum": "" }, "require": { - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" + "illuminate/contracts": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" }, - "time": "2021-03-26T18:39:16+00:00", + "time": "2022-06-09T14:13:53+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -587,56 +637,57 @@ }, { "name": "illuminate/support", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "f542bb78a8a1013ab33fbe14974c45b2a88993d0" + "reference": "07b158210af5aaca51049c8e87606046ae6573e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/f542bb78a8a1013ab33fbe14974c45b2a88993d0", - "reference": "f542bb78a8a1013ab33fbe14974c45b2a88993d0", + "url": "https://api.github.com/repos/illuminate/support/zipball/07b158210af5aaca51049c8e87606046ae6573e2", + "reference": "07b158210af5aaca51049c8e87606046ae6573e2", "shasum": "" }, "require": { - "doctrine/inflector": "^1.4|^2.0", + "doctrine/inflector": "^2.0", "ext-json": "*", "ext-mbstring": "*", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", + "illuminate/collections": "^9.0", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", "nesbot/carbon": "^2.53.1", - "php": "^7.3|^8.0", - "voku/portable-ascii": "^1.4.8" + "php": "^8.0.2", + "voku/portable-ascii": "^2.0" }, "conflict": { "tightenco/collect": "<5.5.33" }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "illuminate/filesystem": "Required to use the composer class (^9.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^5.4).", - "symfony/var-dumper": "Required to use the dd function (^5.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + "symfony/process": "Required to use the composer class (^6.0).", + "symfony/var-dumper": "Required to use the dd function (^6.0).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, - "time": "2021-12-03T15:33:45+00:00", + "time": "2022-06-21T14:08:45+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, "files": [ "helpers.php" - ] + ], + "psr-4": { + "Illuminate\\Support\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -658,35 +709,35 @@ }, { "name": "illuminate/view", - "version": "v8.75.0", - "version_normalized": "8.75.0.0", + "version": "v9.18.0", + "version_normalized": "9.18.0.0", "source": { "type": "git", "url": "https://github.com/illuminate/view.git", - "reference": "85a20375dc9083191eb5350a6a9e4a392ebb3148" + "reference": "7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/view/zipball/85a20375dc9083191eb5350a6a9e4a392ebb3148", - "reference": "85a20375dc9083191eb5350a6a9e4a392ebb3148", + "url": "https://api.github.com/repos/illuminate/view/zipball/7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3", + "reference": "7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/events": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0" - }, - "time": "2021-12-07T08:18:44+00:00", + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/events": "^9.0", + "illuminate/filesystem": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "php": "^8.0.2" + }, + "time": "2022-06-15T07:05:00+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "installation-source": "dist", @@ -715,17 +766,17 @@ }, { "name": "nesbot/carbon", - "version": "2.55.2", - "version_normalized": "2.55.2.0", + "version": "2.58.0", + "version_normalized": "2.58.0.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2" + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8c2a18ce3e67c34efc1b29f64fe61304368259a2", - "reference": "8c2a18ce3e67c34efc1b29f64fe61304368259a2", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/97a34af22bde8d0ac20ab34b29d7bfe360902055", + "reference": "97a34af22bde8d0ac20ab34b29d7bfe360902055", "shasum": "" }, "require": { @@ -742,11 +793,12 @@ "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", - "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "phpstan/phpstan": "^0.12.54 || ^1.0", + "phpunit/php-file-iterator": "^2.0.5", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", "squizlabs/php_codesniffer": "^3.4" }, - "time": "2021-12-03T14:59:52+00:00", + "time": "2022-04-25T19:31:17+00:00", "bin": [ "bin/carbon" ], @@ -814,24 +866,29 @@ }, { "name": "psr/container", - "version": "1.1.2", - "version_normalized": "1.1.2.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { "php": ">=7.4.0" }, - "time": "2021-11-05T16:50:12+00:00", + "time": "2021-11-05T16:47:00+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "installation-source": "dist", "autoload": { "psr-4": { @@ -859,33 +916,33 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/2.0.2" }, "install-path": "../psr/container" }, { "name": "psr/simple-cache", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, - "time": "2017-10-23T01:57:42+00:00", + "time": "2021-10-29T13:26:27+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } }, "installation-source": "dist", @@ -901,7 +958,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for simple caching", @@ -912,28 +969,30 @@ "psr-16", "simple-cache" ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, "install-path": "../psr/simple-cache" }, { "name": "symfony/css-selector", - "version": "v5.4.0", - "version_normalized": "5.4.0.0", + "version": "v6.0.3", + "version_normalized": "6.0.3.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "44b933f98bb4b5220d10bed9ce5662f8c2d13dcc" + "reference": "1955d595c12c111629cc814d3f2a2ff13580508a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/44b933f98bb4b5220d10bed9ce5662f8c2d13dcc", - "reference": "44b933f98bb4b5220d10bed9ce5662f8c2d13dcc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/1955d595c12c111629cc814d3f2a2ff13580508a", + "reference": "1955d595c12c111629cc814d3f2a2ff13580508a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, - "time": "2021-09-09T08:06:01+00:00", + "time": "2022-01-02T09:55:41+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -965,7 +1024,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.0" + "source": "https://github.com/symfony/css-selector/tree/v6.0.3" }, "funding": [ { @@ -983,97 +1042,25 @@ ], "install-path": "../symfony/css-selector" }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.0", - "version_normalized": "3.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "time": "2021-11-01T23:48:49+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, { "name": "symfony/finder", - "version": "v5.4.0", - "version_normalized": "5.4.0.0", + "version": "v6.0.8", + "version_normalized": "6.0.8.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", - "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", + "url": "https://api.github.com/repos/symfony/finder/zipball/af7edab28d17caecd1f40a9219fc646ae751c21f", + "reference": "af7edab28d17caecd1f40a9219fc646ae751c21f", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, - "time": "2021-11-28T15:25:38+00:00", + "time": "2022-04-15T08:07:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1101,7 +1088,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.0" + "source": "https://github.com/symfony/finder/tree/v6.0.8" }, "funding": [ { @@ -1121,30 +1108,33 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.26.0", + "version_normalized": "1.26.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-05-27T12:26:48+00:00", + "time": "2022-05-24T11:49:31+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1153,12 +1143,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1184,7 +1174,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -1204,27 +1194,27 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.26.0", + "version_normalized": "1.26.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-07-28T13:41:28+00:00", + "time": "2022-05-10T07:21:04+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1233,12 +1223,12 @@ }, "installation-source": "dist", "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -1270,7 +1260,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -1290,17 +1280,17 @@ }, { "name": "symfony/translation", - "version": "v6.0.1", - "version_normalized": "6.0.1.0", + "version": "v6.0.9", + "version_normalized": "6.0.9.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "b7956e00c6e03546f2ba489fc50f7c47933e76b8" + "reference": "9ba011309943955a3807b8236c17cff3b88f67b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/b7956e00c6e03546f2ba489fc50f7c47933e76b8", - "reference": "b7956e00c6e03546f2ba489fc50f7c47933e76b8", + "url": "https://api.github.com/repos/symfony/translation/zipball/9ba011309943955a3807b8236c17cff3b88f67b6", + "reference": "9ba011309943955a3807b8236c17cff3b88f67b6", "shasum": "" }, "require": { @@ -1337,7 +1327,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2021-12-08T15:13:44+00:00", + "time": "2022-05-06T14:27:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1368,7 +1358,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.1" + "source": "https://github.com/symfony/translation/tree/v6.0.9" }, "funding": [ { @@ -1388,17 +1378,17 @@ }, { "name": "symfony/translation-contracts", - "version": "v3.0.0", - "version_normalized": "3.0.0.0", + "version": "v3.0.1", + "version_normalized": "3.0.1.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" + "reference": "c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9" }, "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/c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9", + "reference": "c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9", "shasum": "" }, "require": { @@ -1407,7 +1397,7 @@ "suggest": { "symfony/translation-implementation": "" }, - "time": "2021-09-07T12:43:40+00:00", + "time": "2022-01-02T09:55:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -1449,7 +1439,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.1" }, "funding": [ { @@ -1469,28 +1459,28 @@ }, { "name": "voku/html-min", - "version": "4.4.8", - "version_normalized": "4.4.8.0", + "version": "4.5.0", + "version_normalized": "4.5.0.0", "source": { "type": "git", "url": "https://github.com/voku/HtmlMin.git", - "reference": "4f700584abd70b308b7d06b8e4cfcc31711faaf9" + "reference": "2c79e17121bdce16844b1190423bfe0c9537885b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/HtmlMin/zipball/4f700584abd70b308b7d06b8e4cfcc31711faaf9", - "reference": "4f700584abd70b308b7d06b8e4cfcc31711faaf9", + "url": "https://api.github.com/repos/voku/HtmlMin/zipball/2c79e17121bdce16844b1190423bfe0c9537885b", + "reference": "2c79e17121bdce16844b1190423bfe0c9537885b", "shasum": "" }, "require": { "ext-dom": "*", "php": ">=7.0.0", - "voku/simple_html_dom": "~4.7.23" + "voku/simple_html_dom": "~4.8.5" }, "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0" + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" }, - "time": "2020-08-11T22:13:23+00:00", + "time": "2022-06-09T07:37:14+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1505,7 +1495,7 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "description": "HTML Compressor and Minifier", @@ -1517,6 +1507,10 @@ "html", "minifier" ], + "support": { + "issues": "https://github.com/voku/HtmlMin/issues", + "source": "https://github.com/voku/HtmlMin/tree/4.5.0" + }, "funding": [ { "url": "https://www.paypal.me/moelleken", @@ -1535,17 +1529,17 @@ }, { "name": "voku/portable-ascii", - "version": "1.5.6", - "version_normalized": "1.5.6.0", + "version": "2.0.1", + "version_normalized": "2.0.1.0", "source": { "type": "git", "url": "https://github.com/voku/portable-ascii.git", - "reference": "80953678b19901e5165c56752d087fc11526017c" + "reference": "b56450eed252f6801410d810c8e1727224ae0743" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", - "reference": "80953678b19901e5165c56752d087fc11526017c", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b56450eed252f6801410d810c8e1727224ae0743", + "reference": "b56450eed252f6801410d810c8e1727224ae0743", "shasum": "" }, "require": { @@ -1557,7 +1551,7 @@ "suggest": { "ext-intl": "Use Intl for transliterator_transliterate() support" }, - "time": "2020-11-12T00:07:28+00:00", + "time": "2022-03-08T17:03:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1584,7 +1578,7 @@ ], "support": { "issues": "https://github.com/voku/portable-ascii/issues", - "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + "source": "https://github.com/voku/portable-ascii/tree/2.0.1" }, "funding": [ { @@ -1612,17 +1606,17 @@ }, { "name": "voku/simple_html_dom", - "version": "4.7.30", - "version_normalized": "4.7.30.0", + "version": "4.8.6", + "version_normalized": "4.8.6.0", "source": { "type": "git", "url": "https://github.com/voku/simple_html_dom.git", - "reference": "f2be14b8afa7d9a8e5fbc90d93541c23a2134876" + "reference": "1df7e9844eddbe190450c87f281e87bbd8d7f645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/voku/simple_html_dom/zipball/f2be14b8afa7d9a8e5fbc90d93541c23a2134876", - "reference": "f2be14b8afa7d9a8e5fbc90d93541c23a2134876", + "url": "https://api.github.com/repos/voku/simple_html_dom/zipball/1df7e9844eddbe190450c87f281e87bbd8d7f645", + "reference": "1df7e9844eddbe190450c87f281e87bbd8d7f645", "shasum": "" }, "require": { @@ -1630,7 +1624,7 @@ "ext-libxml": "*", "ext-simplexml": "*", "php": ">=7.0.0", - "symfony/css-selector": "~3.0 || ~4.0 || ~5.0" + "symfony/css-selector": "~3.0 || ~4.0 || ~5.0 || ~6.0" }, "require-dev": { "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" @@ -1638,7 +1632,7 @@ "suggest": { "voku/portable-utf8": "If you need e.g. UTF-8 fixed output." }, - "time": "2021-11-25T05:03:35+00:00", + "time": "2022-06-09T05:48:45+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1672,7 +1666,7 @@ ], "support": { "issues": "https://github.com/voku/simple_html_dom/issues", - "source": "https://github.com/voku/simple_html_dom/tree/4.7.30" + "source": "https://github.com/voku/simple_html_dom/tree/4.8.6" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index f262a30..48b1f4a 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,226 +1,226 @@ array( - 'pretty_version' => '1.9.2', - 'version' => '1.9.2.0', + 'name' => 'afbora/kirby-blade', + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'reference' => NULL, 'type' => 'kirby-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, - 'name' => 'afbora/kirby-blade', 'dev' => true, ), 'versions' => array( 'afbora/kirby-blade' => array( - 'pretty_version' => '1.9.2', - 'version' => '1.9.2.0', + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'reference' => NULL, 'type' => 'kirby-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, 'dev_requirement' => false, ), 'doctrine/inflector' => array( 'pretty_version' => '2.0.4', 'version' => '2.0.4.0', + 'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), - 'reference' => '8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89', 'dev_requirement' => false, ), 'getkirby/composer-installer' => array( 'pretty_version' => '1.2.1', 'version' => '1.2.1.0', + 'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../getkirby/composer-installer', 'aliases' => array(), - 'reference' => 'c98ece30bfba45be7ce457e1102d1b169d922f3d', 'dev_requirement' => false, ), 'illuminate/bus' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '14060207ad684e6ea29b9ff3f349813d1d2a2a0a', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/bus', 'aliases' => array(), - 'reference' => '82ed7d9d6edc625ffe5d01fe17af3e223aed1cb0', 'dev_requirement' => false, ), 'illuminate/collections' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '239c9274b8008fb9532ada0899365d1e182f8f9d', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/collections', 'aliases' => array(), - 'reference' => '5a018387352afa2af30fd2be0a78c31e93295720', + 'dev_requirement' => false, + ), + 'illuminate/conditionable' => array( + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '46b7beed47948bd2e67f523d0a76daa62775031e', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/conditionable', + 'aliases' => array(), 'dev_requirement' => false, ), 'illuminate/container' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => 'd86b073cae04713cf28def54417fa771621bc4f1', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), - 'reference' => '6ac391bb27391706c5f921b85060aa2c4ca03fae', 'dev_requirement' => false, ), 'illuminate/contracts' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => 'e014cf88ef46065b8b1f078893c01189b95ffb11', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), - 'reference' => 'b07755f7c456cf587dfbfd6f0854f9f7c1a34b2f', 'dev_requirement' => false, ), 'illuminate/events' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '2dea521665d295f6cefef78f1b5abeea6b94e35f', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/events', 'aliases' => array(), - 'reference' => 'b7f06cafb6c09581617f2ca05d69e9b159e5a35d', 'dev_requirement' => false, ), 'illuminate/filesystem' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '0a73863f90e905d1d5053108fa2a270b2ec6fb0f', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/filesystem', 'aliases' => array(), - 'reference' => 'b8f4b43a65d0e93312d8599bc4e86e21f68f7ccf', 'dev_requirement' => false, ), 'illuminate/macroable' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '25a2c6dac2b7541ecbadef952702e84ae15f5354', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/macroable', 'aliases' => array(), - 'reference' => 'aed81891a6e046fdee72edd497f822190f61c162', 'dev_requirement' => false, ), 'illuminate/pipeline' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => 'e0be3f3f79f8235ad7334919ca4094d5074e02f6', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/pipeline', 'aliases' => array(), - 'reference' => '23aeff5b26ae4aee3f370835c76bd0f4e93f71d2', 'dev_requirement' => false, ), 'illuminate/support' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '07b158210af5aaca51049c8e87606046ae6573e2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/support', 'aliases' => array(), - 'reference' => 'f542bb78a8a1013ab33fbe14974c45b2a88993d0', 'dev_requirement' => false, ), 'illuminate/view' => array( - 'pretty_version' => 'v8.75.0', - 'version' => '8.75.0.0', + 'pretty_version' => 'v9.18.0', + 'version' => '9.18.0.0', + 'reference' => '7a82bca7f1869a35be0cf9a8db5b4f16c540f3d3', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/view', 'aliases' => array(), - 'reference' => '85a20375dc9083191eb5350a6a9e4a392ebb3148', 'dev_requirement' => false, ), 'nesbot/carbon' => array( - 'pretty_version' => '2.55.2', - 'version' => '2.55.2.0', + 'pretty_version' => '2.58.0', + 'version' => '2.58.0.0', + 'reference' => '97a34af22bde8d0ac20ab34b29d7bfe360902055', 'type' => 'library', 'install_path' => __DIR__ . '/../nesbot/carbon', 'aliases' => array(), - 'reference' => '8c2a18ce3e67c34efc1b29f64fe61304368259a2', 'dev_requirement' => false, ), 'psr/container' => array( - 'pretty_version' => '1.1.2', - 'version' => '1.1.2.0', + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', 'dev_requirement' => false, ), 'psr/container-implementation' => array( 'dev_requirement' => false, 'provided' => array( - 0 => '1.0', + 0 => '1.1|2.0', ), ), 'psr/simple-cache' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', 'dev_requirement' => false, ), 'symfony/css-selector' => array( - 'pretty_version' => 'v5.4.0', - 'version' => '5.4.0.0', + 'pretty_version' => 'v6.0.3', + 'version' => '6.0.3.0', + 'reference' => '1955d595c12c111629cc814d3f2a2ff13580508a', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/css-selector', 'aliases' => array(), - 'reference' => '44b933f98bb4b5220d10bed9ce5662f8c2d13dcc', - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.0.0', - 'version' => '3.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => 'c726b64c1ccfe2896cb7df2e1331c357ad1c8ced', 'dev_requirement' => false, ), 'symfony/finder' => array( - 'pretty_version' => 'v5.4.0', - 'version' => '5.4.0.0', + 'pretty_version' => 'v6.0.8', + 'version' => '6.0.8.0', + 'reference' => 'af7edab28d17caecd1f40a9219fc646ae751c21f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), - 'reference' => 'd2f29dac98e96a98be467627bd49c2efb1bc2590', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.26.0', + 'version' => '1.26.0.0', + 'reference' => '9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.26.0', + 'version' => '1.26.0.0', + 'reference' => 'cfa0ae98841b9e461207c13ab093d76b0fa7bace', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', 'dev_requirement' => false, ), 'symfony/translation' => array( - 'pretty_version' => 'v6.0.1', - 'version' => '6.0.1.0', + 'pretty_version' => 'v6.0.9', + 'version' => '6.0.9.0', + 'reference' => '9ba011309943955a3807b8236c17cff3b88f67b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), - 'reference' => 'b7956e00c6e03546f2ba489fc50f7c47933e76b8', 'dev_requirement' => false, ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v3.0.0', - 'version' => '3.0.0.0', + 'pretty_version' => 'v3.0.1', + 'version' => '3.0.1.0', + 'reference' => 'c4183fc3ef0f0510893cbeedc7718fb5cafc9ac9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), - 'reference' => '1b6ea5a7442af5a12dba3dbd6d71034b5b234e77', 'dev_requirement' => false, ), 'symfony/translation-implementation' => array( @@ -230,30 +230,30 @@ ), ), 'voku/html-min' => array( - 'pretty_version' => '4.4.8', - 'version' => '4.4.8.0', + 'pretty_version' => '4.5.0', + 'version' => '4.5.0.0', + 'reference' => '2c79e17121bdce16844b1190423bfe0c9537885b', 'type' => 'library', 'install_path' => __DIR__ . '/../voku/html-min', 'aliases' => array(), - 'reference' => '4f700584abd70b308b7d06b8e4cfcc31711faaf9', 'dev_requirement' => false, ), 'voku/portable-ascii' => array( - 'pretty_version' => '1.5.6', - 'version' => '1.5.6.0', + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => 'b56450eed252f6801410d810c8e1727224ae0743', 'type' => 'library', 'install_path' => __DIR__ . '/../voku/portable-ascii', 'aliases' => array(), - 'reference' => '80953678b19901e5165c56752d087fc11526017c', 'dev_requirement' => false, ), 'voku/simple_html_dom' => array( - 'pretty_version' => '4.7.30', - 'version' => '4.7.30.0', + 'pretty_version' => '4.8.6', + 'version' => '4.8.6.0', + 'reference' => '1df7e9844eddbe190450c87f281e87bbd8d7f645', 'type' => 'library', 'install_path' => __DIR__ . '/../voku/simple_html_dom', 'aliases' => array(), - 'reference' => 'f2be14b8afa7d9a8e5fbc90d93541c23a2134876', 'dev_requirement' => false, ), ), diff --git a/vendor/illuminate/bus/Batch.php b/vendor/illuminate/bus/Batch.php index db8779d..644bfbc 100644 --- a/vendor/illuminate/bus/Batch.php +++ b/vendor/illuminate/bus/Batch.php @@ -155,7 +155,7 @@ public function fresh() /** * Add additional jobs to the batch. * - * @param \Illuminate\Support\Enumerable|array $jobs + * @param \Illuminate\Support\Enumerable|object|array $jobs * @return self */ public function add($jobs) @@ -462,9 +462,19 @@ public function toArray() * * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } + + /** + * Dynamically access the batch's "options" via properties. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + return $this->options[$key] ?? null; + } } diff --git a/vendor/illuminate/bus/DatabaseBatchRepository.php b/vendor/illuminate/bus/DatabaseBatchRepository.php index ee544b0..de91c88 100644 --- a/vendor/illuminate/bus/DatabaseBatchRepository.php +++ b/vendor/illuminate/bus/DatabaseBatchRepository.php @@ -59,9 +59,7 @@ public function get($limit = 50, $before = null) return $this->connection->table($this->table) ->orderByDesc('id') ->take($limit) - ->when($before, function ($q) use ($before) { - return $q->where('id', '<', $before); - }) + ->when($before, fn ($q) => $q->where('id', '<', $before)) ->get() ->map(function ($batch) { return $this->toBatch($batch); @@ -286,9 +284,7 @@ public function pruneUnfinished(DateTimeInterface $before) */ public function transaction(Closure $callback) { - return $this->connection->transaction(function () use ($callback) { - return $callback(); - }); + return $this->connection->transaction(fn () => $callback()); } /** diff --git a/vendor/illuminate/bus/PendingBatch.php b/vendor/illuminate/bus/PendingBatch.php index a831c5f..6cd5183 100644 --- a/vendor/illuminate/bus/PendingBatch.php +++ b/vendor/illuminate/bus/PendingBatch.php @@ -6,9 +6,9 @@ use Illuminate\Bus\Events\BatchDispatched; use Illuminate\Contracts\Container\Container; use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; -use Illuminate\Queue\SerializableClosureFactory; use Illuminate\Support\Arr; use Illuminate\Support\Collection; +use Laravel\SerializableClosure\SerializableClosure; use Throwable; class PendingBatch @@ -57,11 +57,13 @@ public function __construct(Container $container, Collection $jobs) /** * Add jobs to the batch. * - * @param iterable $jobs + * @param iterable|object|array $jobs * @return $this */ public function add($jobs) { + $jobs = is_iterable($jobs) ? $jobs : Arr::wrap($jobs); + foreach ($jobs as $job) { $this->jobs->push($job); } @@ -78,7 +80,7 @@ public function add($jobs) public function then($callback) { $this->options['then'][] = $callback instanceof Closure - ? SerializableClosureFactory::make($callback) + ? new SerializableClosure($callback) : $callback; return $this; @@ -103,7 +105,7 @@ public function thenCallbacks() public function catch($callback) { $this->options['catch'][] = $callback instanceof Closure - ? SerializableClosureFactory::make($callback) + ? new SerializableClosure($callback) : $callback; return $this; @@ -128,7 +130,7 @@ public function catchCallbacks() public function finally($callback) { $this->options['finally'][] = $callback instanceof Closure - ? SerializableClosureFactory::make($callback) + ? new SerializableClosure($callback) : $callback; return $this; @@ -226,6 +228,20 @@ public function queue() return $this->options['queue'] ?? null; } + /** + * Add additional data into the batch's options array. + * + * @param string $key + * @param mixed $value + * @return $this + */ + public function withOption(string $key, $value) + { + $this->options[$key] = $value; + + return $this; + } + /** * Dispatch the batch. * @@ -255,4 +271,49 @@ public function dispatch() return $batch; } + + /** + * Dispatch the batch after the response is sent to the browser. + * + * @return \Illuminate\Bus\Batch + */ + public function dispatchAfterResponse() + { + $repository = $this->container->make(BatchRepository::class); + + $batch = $repository->store($this); + + if ($batch) { + $this->container->terminating(function () use ($batch) { + $this->dispatchExistingBatch($batch); + }); + } + + return $batch; + } + + /** + * Dispatch an existing batch. + * + * @param \Illuminate\Bus\Batch $batch + * @return void + * + * @throws \Throwable + */ + protected function dispatchExistingBatch($batch) + { + try { + $batch = $batch->add($this->jobs); + } catch (Throwable $e) { + if (isset($batch)) { + $batch->delete(); + } + + throw $e; + } + + $this->container->make(EventDispatcher::class)->dispatch( + new BatchDispatched($batch) + ); + } } diff --git a/vendor/illuminate/bus/Queueable.php b/vendor/illuminate/bus/Queueable.php index 8e93060..3d3bbb9 100644 --- a/vendor/illuminate/bus/Queueable.php +++ b/vendor/illuminate/bus/Queueable.php @@ -47,7 +47,7 @@ trait Queueable /** * The number of seconds before the job should be made available. * - * @var \DateTimeInterface|\DateInterval|int|null + * @var \DateTimeInterface|\DateInterval|array|int|null */ public $delay; @@ -127,9 +127,9 @@ public function allOnQueue($queue) } /** - * Set the desired delay for the job. + * Set the desired delay in seconds for the job. * - * @param \DateTimeInterface|\DateInterval|int|null $delay + * @param \DateTimeInterface|\DateInterval|array|int|null $delay * @return $this */ public function delay($delay) @@ -191,6 +191,32 @@ public function chain($chain) return $this; } + /** + * Prepend a job to the current chain so that it is run after the currently running job. + * + * @param mixed $job + * @return $this + */ + public function prependToChain($job) + { + $this->chained = Arr::prepend($this->chained, $this->serializeJob($job)); + + return $this; + } + + /** + * Append a job to the end of the current chain. + * + * @param mixed $job + * @return $this + */ + public function appendToChain($job) + { + $this->chained = array_merge($this->chained, [$this->serializeJob($job)]); + + return $this; + } + /** * Serialize a job for queuing. * diff --git a/vendor/illuminate/bus/UniqueLock.php b/vendor/illuminate/bus/UniqueLock.php index a937b18..d1bd774 100644 --- a/vendor/illuminate/bus/UniqueLock.php +++ b/vendor/illuminate/bus/UniqueLock.php @@ -36,13 +36,17 @@ public function acquire($job) ? $job->uniqueId() : ($job->uniqueId ?? ''); + $uniqueFor = method_exists($job, 'uniqueFor') + ? $job->uniqueFor() + : ($job->uniqueFor ?? 0); + $cache = method_exists($job, 'uniqueVia') ? $job->uniqueVia() : $this->cache; return (bool) $cache->lock( $key = 'laravel_unique_job:'.get_class($job).$uniqueId, - $job->uniqueFor ?? 0 + $uniqueFor )->get(); } } diff --git a/vendor/illuminate/bus/composer.json b/vendor/illuminate/bus/composer.json index 12713a6..44e795a 100644 --- a/vendor/illuminate/bus/composer.json +++ b/vendor/illuminate/bus/composer.json @@ -14,11 +14,11 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/pipeline": "^8.0", - "illuminate/support": "^8.0" + "php": "^8.0.2", + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/pipeline": "^9.0", + "illuminate/support": "^9.0" }, "autoload": { "psr-4": { @@ -27,7 +27,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { diff --git a/vendor/illuminate/collections/Arr.php b/vendor/illuminate/collections/Arr.php index 8267315..731fa29 100644 --- a/vendor/illuminate/collections/Arr.php +++ b/vendor/illuminate/collections/Arr.php @@ -2,6 +2,7 @@ namespace Illuminate\Support; +use ArgumentCountError; use ArrayAccess; use Illuminate\Support\Traits\Macroable; use InvalidArgumentException; @@ -25,7 +26,7 @@ public static function accessible($value) * 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 @@ public static function undot($array) * 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 @@ public static function exists($array, $key) return $array->offsetExists($key); } + if (is_float($key)) { + $key = (string) $key; + } + return array_key_exists($key, $array); } @@ -252,7 +257,7 @@ public static function flatten($array, $depth = INF) * 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 @@ public static function forget(&$array, $keys) 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 @@ public static function get($array, $key, $default = null) return $array[$key]; } - if (strpos($key, '.') === false) { + if (! str_contains($key, '.')) { return $array[$key] ?? value($default); } @@ -423,6 +428,59 @@ public static function isList($array) 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 @@ protected static function explodePluckParameters($value, $key) 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. * @@ -587,7 +665,7 @@ public static function random($array, $number = null, $preserveKeys = false) * 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 */ diff --git a/vendor/illuminate/collections/Collection.php b/vendor/illuminate/collections/Collection.php index 6226519..f06dd18 100644 --- a/vendor/illuminate/collections/Collection.php +++ b/vendor/illuminate/collections/Collection.php @@ -8,22 +8,33 @@ use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; use stdClass; - +use Traversable; + +/** + * @template TKey of array-key + * @template TValue + * + * @implements \ArrayAccess + * @implements \Illuminate\Support\Enumerable + */ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable { + /** + * @use \Illuminate\Support\Traits\EnumeratesValues + */ use EnumeratesValues, Macroable; /** * The items contained in the collection. * - * @var array + * @var array */ protected $items = []; /** * Create a new collection. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items * @return void */ public function __construct($items = []) @@ -36,7 +47,7 @@ public function __construct($items = []) * * @param int $from * @param int $to - * @return static + * @return static */ public static function range($from, $to) { @@ -46,7 +57,7 @@ public static function range($from, $to) /** * Get all of the items in the collection. * - * @return array + * @return array */ public function all() { @@ -56,7 +67,7 @@ public function all() /** * Get a lazy collection for the items in this collection. * - * @return \Illuminate\Support\LazyCollection + * @return \Illuminate\Support\LazyCollection */ public function lazy() { @@ -66,8 +77,8 @@ public function lazy() /** * 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) { @@ -87,8 +98,8 @@ public function avg($callback = null) /** * Get the median of a given key. * - * @param string|array|null $key - * @return mixed + * @param string|array|null $key + * @return float|int|null */ public function median($key = null) { @@ -117,8 +128,8 @@ public function median($key = null) /** * Get the mode of a given key. * - * @param string|array|null $key - * @return array|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null) { @@ -146,7 +157,7 @@ public function mode($key = null) /** * Collapse the collection of items into a single array. * - * @return static + * @return static */ public function collapse() { @@ -156,7 +167,7 @@ public function collapse() /** * 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,11 +187,27 @@ public function contains($key, $operator = null, $value = null) return $this->contains($this->operatorForWhere(...func_get_args())); } + /** + * 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) + { + return ! $this->contains(...func_get_args()); + } + /** * Cross join with the given lists, returning all possible permutations. * - * @param mixed ...$lists - * @return static + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$lists + * @return static> */ public function crossJoin(...$lists) { @@ -192,7 +219,7 @@ public function crossJoin(...$lists) /** * Get the items in the collection that are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diff($items) @@ -203,8 +230,8 @@ public function diff($items) /** * Get the items in the collection that are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback * @return static */ public function diffUsing($items, callable $callback) @@ -215,7 +242,7 @@ public function diffUsing($items, callable $callback) /** * Get the items in the collection whose keys and values are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffAssoc($items) @@ -226,8 +253,8 @@ public function diffAssoc($items) /** * 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 \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffAssocUsing($items, callable $callback) @@ -238,7 +265,7 @@ public function diffAssocUsing($items, callable $callback) /** * Get the items in the collection whose keys are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffKeys($items) @@ -249,8 +276,8 @@ public function diffKeys($items) /** * 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 \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffKeysUsing($items, callable $callback) @@ -261,7 +288,7 @@ public function diffKeysUsing($items, callable $callback) /** * Retrieve duplicate items from the collection. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @param bool $strict * @return static */ @@ -289,7 +316,7 @@ public function duplicates($callback = null, $strict = false) /** * 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) @@ -301,7 +328,7 @@ public function duplicatesStrict($callback = null) * Get the comparison function to detect duplicates. * * @param bool $strict - * @return \Closure + * @return callable(TValue, TValue): bool */ protected function duplicateComparator($strict) { @@ -319,7 +346,7 @@ protected function duplicateComparator($strict) /** * Get all items except for those with the specified keys. * - * @param \Illuminate\Support\Collection|mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function except($keys) @@ -336,7 +363,7 @@ public function except($keys) /** * 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) @@ -351,9 +378,11 @@ public function filter(callable $callback = null) /** * 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) { @@ -364,7 +393,7 @@ public function first(callable $callback = null, $default = null) * Get a flattened array of the items in the collection. * * @param int $depth - * @return static + * @return static */ public function flatten($depth = INF) { @@ -374,7 +403,7 @@ public function flatten($depth = INF) /** * Flip the items in the collection. * - * @return static + * @return static */ public function flip() { @@ -384,7 +413,7 @@ public function flip() /** * Remove an item from the collection by key. * - * @param string|array $keys + * @param TKey|array $keys * @return $this */ public function forget($keys) @@ -399,9 +428,11 @@ public function forget($keys) /** * 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) { @@ -412,12 +443,30 @@ public function get($key, $default = null) return value($default); } + /** + * Get an item from the collection by key or add it to collection if it does not exist. + * + * @param mixed $key + * @param mixed $value + * @return mixed + */ + public function getOrPut($key, $value) + { + if (array_key_exists($key, $this->items)) { + return $this->items[$key]; + } + + $this->offsetSet($key, $value = value($value)); + + return $value; + } + /** * 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> */ public function groupBy($groupBy, $preserveKeys = false) { @@ -439,7 +488,11 @@ public function groupBy($groupBy, $preserveKeys = false) } 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; @@ -461,8 +514,8 @@ 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 */ public function keyBy($keyBy) { @@ -486,7 +539,7 @@ public function keyBy($keyBy) /** * Determine if an item exists in the collection by key. * - * @param mixed $key + * @param TKey|array $key * @return bool */ public function has($key) @@ -528,12 +581,16 @@ public function hasAny($key) /** * 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 Stringable)) { @@ -546,7 +603,7 @@ public function implode($value, $glue = null) /** * Intersect the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersect($items) @@ -557,7 +614,7 @@ public function intersect($items) /** * Intersect the collection with the given items by key. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersectByKeys($items) @@ -620,7 +677,7 @@ public function join($glue, $finalGlue = '') /** * Get the keys of the collection items. * - * @return static + * @return static */ public function keys() { @@ -630,9 +687,11 @@ 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) { @@ -642,9 +701,9 @@ public function last(callable $callback = null, $default = null) /** * Get the values of a given key. * - * @param string|array|int|null $value + * @param string|int|array $value * @param string|null $key - * @return static + * @return static */ public function pluck($value, $key = null) { @@ -654,16 +713,14 @@ public function pluck($value, $key = null) /** * Run a map over each of the items. * - * @param callable $callback - * @return static + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static */ 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)); } /** @@ -671,8 +728,11 @@ public function map(callable $callback) * * 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 $callback + * @return static> */ public function mapToDictionary(callable $callback) { @@ -700,8 +760,11 @@ public function mapToDictionary(callable $callback) * * 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 $callback + * @return static */ public function mapWithKeys(callable $callback) { @@ -721,7 +784,7 @@ public function mapWithKeys(callable $callback) /** * Merge the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function merge($items) @@ -732,8 +795,10 @@ public function merge($items) /** * Recursively merge the collection with the given items. * - * @param mixed $items - * @return static + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static */ public function mergeRecursive($items) { @@ -743,8 +808,10 @@ 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 \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static */ public function combine($values) { @@ -754,7 +821,7 @@ public function combine($values) /** * Union the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function union($items) @@ -775,8 +842,8 @@ public function nth($step, $offset = 0) $position = 0; - foreach ($this->items as $item) { - if ($position % $step === $offset) { + foreach ($this->slice($offset)->items as $item) { + if ($position % $step === 0) { $new[] = $item; } @@ -789,7 +856,7 @@ public function nth($step, $offset = 0) /** * Get the items with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array|string $keys * @return static */ public function only($keys) @@ -811,7 +878,7 @@ public function only($keys) * Get and remove the last N items from the collection. * * @param int $count - * @return mixed + * @return static|TValue|null */ public function pop($count = 1) { @@ -837,8 +904,8 @@ public function pop($count = 1) /** * 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) @@ -851,7 +918,7 @@ public function prepend($value, $key = null) /** * Push one or more items onto the end of the collection. * - * @param mixed $values + * @param TValue ...$values * @return $this */ public function push(...$values) @@ -866,7 +933,7 @@ public function push(...$values) /** * Push all of the given items onto the collection. * - * @param iterable $source + * @param iterable $source * @return static */ public function concat($source) @@ -883,9 +950,11 @@ public function concat($source) /** * 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) { @@ -895,8 +964,8 @@ public function pull($key, $default = null) /** * 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) @@ -910,7 +979,7 @@ public function put($key, $value) * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static|mixed + * @return static|TValue * * @throws \InvalidArgumentException */ @@ -926,7 +995,7 @@ public function random($number = null) /** * Replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replace($items) @@ -937,7 +1006,7 @@ public function replace($items) /** * Recursively replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replaceRecursive($items) @@ -958,9 +1027,9 @@ public function reverse() /** * 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) { @@ -981,7 +1050,7 @@ public function search($value, $strict = false) * Get and remove the first N items from the collection. * * @param int $count - * @return mixed + * @return static|TValue|null */ public function shift($count = 1) { @@ -1020,7 +1089,7 @@ public function shuffle($seed = null) * * @param int $size * @param int $step - * @return static + * @return static */ public function sliding($size = 2, $step = 1) { @@ -1045,7 +1114,7 @@ public function skip($count) /** * 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) @@ -1056,7 +1125,7 @@ public function skipUntil($value) /** * 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) @@ -1080,7 +1149,7 @@ public function slice($offset, $length = null) * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static + * @return static */ public function split($numberOfGroups) { @@ -1117,7 +1186,7 @@ public function split($numberOfGroups) * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups - * @return static + * @return static */ public function splitIn($numberOfGroups) { @@ -1127,10 +1196,10 @@ public function splitIn($numberOfGroups) /** * 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 \Illuminate\Support\ItemNotFoundException * @throws \Illuminate\Support\MultipleItemsFoundException @@ -1141,14 +1210,16 @@ public function sole($key = null, $operator = null, $value = null) ? $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(); @@ -1157,10 +1228,10 @@ 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 mixed $key + * @param (callable(TValue, TKey): bool)|string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue * * @throws \Illuminate\Support\ItemNotFoundException */ @@ -1185,7 +1256,7 @@ 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 */ public function chunk($size) { @@ -1205,8 +1276,8 @@ public function chunk($size) /** * Chunk the collection into chunks with a callback. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey, static): bool $callback + * @return static> */ public function chunkWhile(callable $callback) { @@ -1218,7 +1289,7 @@ public function chunkWhile(callable $callback) /** * 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) @@ -1250,7 +1321,7 @@ public function sortDesc($options = SORT_REGULAR) /** * Sort the collection using the given callback. * - * @param callable|array|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @param bool $descending * @return static @@ -1267,7 +1338,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) // First we will loop through the items and get the comparator from a callback // function which we were given. Then, we will sort the returned values and - // and grab the corresponding values for the sorted keys from this array. + // grab all the corresponding values for the sorted keys from this array. foreach ($this->items as $key => $value) { $results[$key] = $callback($value, $key); } @@ -1288,7 +1359,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) /** * Sort the collection using multiple comparisons. * - * @param array $comparisons + * @param array $comparisons * @return static */ protected function sortByMany(array $comparisons = []) @@ -1304,9 +1375,7 @@ protected function sortByMany(array $comparisons = []) $ascending = Arr::get($comparison, 1, true) === true || Arr::get($comparison, 1, true) === 'asc'; - $result = 0; - - if (is_callable($prop)) { + if (! is_string($prop) && is_callable($prop)) { $result = $prop($a, $b); } else { $values = [data_get($a, $prop), data_get($b, $prop)]; @@ -1332,7 +1401,7 @@ protected function sortByMany(array $comparisons = []) /** * Sort the collection in descending order using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @return static */ @@ -1368,12 +1437,27 @@ public function sortKeysDesc($options = SORT_REGULAR) return $this->sortKeys($options, true); } + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + $items = $this->items; + + uksort($items, $callback); + + return new static($items); + } + /** * Splice a portion of the underlying collection array. * * @param int $offset * @param int|null $length - * @param mixed $replacement + * @param array $replacement * @return static */ public function splice($offset, $length = null, $replacement = []) @@ -1403,7 +1487,7 @@ public function take($limit) /** * 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) @@ -1414,7 +1498,7 @@ public function takeUntil($value) /** * 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) @@ -1425,7 +1509,7 @@ public function takeWhile($value) /** * 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) @@ -1448,7 +1532,7 @@ 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 */ @@ -1474,7 +1558,7 @@ public function unique($key = null, $strict = false) /** * Reset the keys on the underlying array. * - * @return static + * @return static */ public function values() { @@ -1487,8 +1571,10 @@ public function values() * 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 \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> */ public function zip($items) { @@ -1506,9 +1592,11 @@ public function zip($items) /** * Pad collection to the specified length with a value. * + * @template TPadValue + * * @param int $size - * @param mixed $value - * @return static + * @param TPadValue $value + * @return static */ public function pad($size, $value) { @@ -1518,10 +1606,9 @@ public function pad($size, $value) /** * Get an iterator for the items. * - * @return \ArrayIterator + * @return \ArrayIterator */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->items); } @@ -1531,8 +1618,7 @@ public function getIterator() * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->items); } @@ -1540,8 +1626,8 @@ public function count() /** * 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): mixed)|string|null $countBy + * @return static */ public function countBy($countBy = null) { @@ -1551,7 +1637,7 @@ public function countBy($countBy = null) /** * Add an item to the collection. * - * @param mixed $item + * @param TValue $item * @return $this */ public function add($item) @@ -1564,7 +1650,7 @@ public function add($item) /** * Get a base Support collection instance from this collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function toBase() { @@ -1574,11 +1660,10 @@ public function toBase() /** * 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]); } @@ -1586,11 +1671,10 @@ public function offsetExists($key) /** * 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]; } @@ -1598,12 +1682,11 @@ public function offsetGet($key) /** * 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; @@ -1615,11 +1698,10 @@ public function offsetSet($key, $value) /** * Unset the item at a given offset. * - * @param string $key + * @param TKey $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->items[$key]); } diff --git a/vendor/illuminate/collections/Enumerable.php b/vendor/illuminate/collections/Enumerable.php index 261a0c8..c7f56f2 100644 --- a/vendor/illuminate/collections/Enumerable.php +++ b/vendor/illuminate/collections/Enumerable.php @@ -2,19 +2,31 @@ namespace Illuminate\Support; +use CachingIterator; use Countable; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Jsonable; use IteratorAggregate; use JsonSerializable; - +use Traversable; + +/** + * @template TKey of array-key + * @template TValue + * + * @extends \Illuminate\Contracts\Support\Arrayable + * @extends \IteratorAggregate + */ 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 \Illuminate\Contracts\Support\Arrayable|iterable|null $items + * @return static */ public static function make($items = []); @@ -39,16 +51,22 @@ public static function range($from, $to); /** * Wrap the given value in a collection if applicable. * - * @param mixed $value - * @return static + * @template TWrapKey of array-key + * @template TWrapValue + * + * @param iterable $value + * @return static */ 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|static $value + * @return array */ public static function unwrap($value); @@ -69,38 +87,38 @@ public function all(); /** * 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|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|null $key + * @return array|null */ public function mode($key = null); /** * Collapse the items into a single enumerable. * - * @return static + * @return static */ 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 +128,8 @@ public function some($key, $operator = null, $value = null); /** * 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 +137,39 @@ public function containsStrict($key, $value = null); /** * 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 \Illuminate\Contracts\Support\Arrayable|iterable ...$lists + * @return static> */ public function crossJoin(...$lists); @@ -146,7 +177,7 @@ public function crossJoin(...$lists); * Dump the collection and end the script. * * @param mixed ...$args - * @return void + * @return never */ public function dd(...$args); @@ -160,7 +191,7 @@ public function dump(); /** * Get the items that are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diff($items); @@ -168,8 +199,8 @@ public function diff($items); /** * Get the items that are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback * @return static */ public function diffUsing($items, callable $callback); @@ -177,7 +208,7 @@ public function diffUsing($items, callable $callback); /** * Get the items whose keys and values are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffAssoc($items); @@ -185,8 +216,8 @@ public function diffAssoc($items); /** * Get the items whose keys and values are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffAssocUsing($items, callable $callback); @@ -194,7 +225,7 @@ public function diffAssocUsing($items, callable $callback); /** * Get the items whose keys are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffKeys($items); @@ -202,8 +233,8 @@ public function diffKeys($items); /** * Get the items whose keys are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffKeysUsing($items, callable $callback); @@ -211,7 +242,7 @@ public function diffKeysUsing($items, callable $callback); /** * Retrieve duplicate items. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @param bool $strict * @return static */ @@ -220,7 +251,7 @@ public function duplicates($callback = null, $strict = false); /** * 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 +259,7 @@ public function duplicatesStrict($callback = null); /** * Execute a callback over each item. * - * @param callable $callback + * @param callable(TValue, TKey): mixed $callback * @return $this */ public function each(callable $callback); @@ -244,7 +275,7 @@ public function eachSpread(callable $callback); /** * 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 +285,7 @@ public function every($key, $operator = null, $value = null); /** * Get all items except for those with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function except($keys); @@ -262,64 +293,76 @@ public function except($keys); /** * 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 +405,7 @@ public function whereStrict($key, $value); * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -372,7 +415,7 @@ public function whereIn($key, $values, $strict = false); * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereInStrict($key, $values); @@ -381,7 +424,7 @@ public function whereInStrict($key, $values); * Filter items such that the value of the given key is between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereBetween($key, $values); @@ -390,7 +433,7 @@ public function whereBetween($key, $values); * Filter items such that the value of the given key is not between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotBetween($key, $values); @@ -399,7 +442,7 @@ public function whereNotBetween($key, $values); * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -409,7 +452,7 @@ public function whereNotIn($key, $values, $strict = false); * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotInStrict($key, $values); @@ -417,17 +460,21 @@ public function whereNotInStrict($key, $values); /** * 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|array> $type + * @return static */ 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 +484,7 @@ public function first(callable $callback = null, $default = null); * @param string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue|null */ public function firstWhere($key, $operator = null, $value = null); @@ -452,44 +499,54 @@ public function flatten($depth = INF); /** * Flip the values with their keys. * - * @return static + * @return static */ 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> */ 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 */ public function keyBy($keyBy); /** * Determine if an item exists in the collection by key. * - * @param mixed $key + * @param TKey|array $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 +559,7 @@ public function implode($value, $glue = null); /** * Intersect the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersect($items); @@ -510,7 +567,7 @@ public function intersect($items); /** * Intersect the collection with the given items by key. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersectByKeys($items); @@ -529,6 +586,13 @@ public function isEmpty(); */ 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 +605,28 @@ public function join($glue, $finalGlue = ''); /** * Get the keys of the collection items. * - * @return static + * @return static */ 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 */ public function map(callable $callback); @@ -575,8 +643,11 @@ public function mapSpread(callable $callback); * * 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 $callback + * @return static> */ public function mapToDictionary(callable $callback); @@ -585,8 +656,11 @@ public function mapToDictionary(callable $callback); * * 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 $callback + * @return static> */ public function mapToGroups(callable $callback); @@ -595,31 +669,36 @@ public function mapToGroups(callable $callback); * * 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 $callback + * @return static */ public function mapWithKeys(callable $callback); /** * Map a collection and flatten the result by a single level. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey): mixed $callback + * @return static */ public function flatMap(callable $callback); /** * Map the values into a new class. * - * @param string $class - * @return static + * @template TMapIntoValue + * + * @param class-string $class + * @return static */ public function mapInto($class); /** * Merge the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function merge($items); @@ -627,23 +706,27 @@ public function merge($items); /** * Recursively merge the collection with the given items. * - * @param mixed $items - * @return static + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static */ 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 \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static */ public function combine($values); /** * Union the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function union($items); @@ -651,16 +734,16 @@ public function union($items); /** * Get the min value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function min($callback = null); /** * Get the max value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function max($callback = null); @@ -676,7 +759,7 @@ public function nth($step, $offset = 0); /** * Get the items with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array|string $keys * @return static */ public function only($keys); @@ -693,17 +776,17 @@ public function forPage($page, $perPage); /** * 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, static> */ public function partition($key, $operator = null, $value = null); /** * Push all of the given items onto the collection. * - * @param iterable $source + * @param iterable $source * @return static */ public function concat($source); @@ -712,7 +795,7 @@ public function concat($source); * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static|mixed + * @return static|TValue * * @throws \InvalidArgumentException */ @@ -721,16 +804,30 @@ public function random($number = null); /** * 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 \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replace($items); @@ -738,7 +835,7 @@ public function replace($items); /** * Recursively replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replaceRecursive($items); @@ -753,9 +850,9 @@ public function reverse(); /** * 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 +864,15 @@ public function search($value, $strict = false); */ 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 + */ + public function sliding($size = 2, $step = 1); + /** * Skip the first {$count} items. * @@ -778,7 +884,7 @@ public function skip($count); /** * 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 +892,7 @@ public function skipUntil($value); /** * 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 +910,63 @@ public function slice($offset, $length = null); * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static + * @return 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 \Illuminate\Support\ItemNotFoundException + * @throws \Illuminate\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 \Illuminate\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 */ public function chunk($size); /** * Chunk the collection into chunks with a callback. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey, static): bool $callback + * @return static> */ 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 + */ + 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 +982,7 @@ public function sortDesc($options = SORT_REGULAR); /** * Sort the collection using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @param bool $descending * @return static @@ -853,7 +992,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false); /** * Sort the collection in descending order using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @return static */ @@ -876,10 +1015,18 @@ public function sortKeys($options = SORT_REGULAR, $descending = false); */ 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 +1042,7 @@ public function take($limit); /** * 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 +1050,7 @@ public function takeUntil($value); /** * 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 +1058,7 @@ public function takeWhile($value); /** * 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 +1066,57 @@ public function tap(callable $callback); /** * 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 $pipes + * @return mixed + */ + public function pipeThrough($pipes); + /** * Get the values of a given key. * - * @param string|array $value + * @param string|array $value * @param string|null $key - * @return static + * @return static */ 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 $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 +1125,7 @@ public function unique($key = null, $strict = false); /** * 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,24 +1133,40 @@ public function uniqueStrict($key = null); /** * Reset the keys on the underlying array. * - * @return static + * @return static */ 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 */ 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 + */ + 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): mixed)|string|null $countBy + * @return static */ public function countBy($callback = null); @@ -988,18 +1176,50 @@ public function countBy($callback = null); * 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 \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> */ public function zip($items); /** * Collect the values into a collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function collect(); + /** + * Get the collection of items as a plain array. + * + * @return array + */ + 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 +1227,14 @@ public function collect(); */ 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/vendor/illuminate/collections/LazyCollection.php b/vendor/illuminate/collections/LazyCollection.php index f0f2a8d..a337991 100644 --- a/vendor/illuminate/collections/LazyCollection.php +++ b/vendor/illuminate/collections/LazyCollection.php @@ -5,27 +5,39 @@ use ArrayIterator; use Closure; use DateTimeInterface; +use Generator; use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString; use Illuminate\Support\Traits\EnumeratesValues; use Illuminate\Support\Traits\Macroable; +use InvalidArgumentException; use IteratorAggregate; use stdClass; - +use Traversable; + +/** + * @template TKey of array-key + * @template TValue + * + * @implements \Illuminate\Support\Enumerable + */ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable { + /** + * @use \Illuminate\Support\Traits\EnumeratesValues + */ use EnumeratesValues, Macroable; /** * The source from which to generate items. * - * @var callable|static + * @var (Closure(): \Generator)|static|array */ public $source; /** * Create a new lazy collection instance. * - * @param mixed $source + * @param \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $source * @return void */ public function __construct($source = null) @@ -34,17 +46,35 @@ public function __construct($source = null) $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 \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $items + * @return static + */ + 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 */ public static function range($from, $to) { @@ -64,7 +94,7 @@ public static function range($from, $to) /** * Get all items in the enumerable. * - * @return array + * @return array */ public function all() { @@ -126,8 +156,8 @@ public function remember() /** * 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 @@ public function avg($callback = null) /** * Get the median of a given key. * - * @param string|array|null $key - * @return mixed + * @param string|array|null $key + * @return float|int|null */ public function median($key = null) { @@ -148,8 +178,8 @@ public function median($key = null) /** * Get the mode of a given key. * - * @param string|array|null $key - * @return array|null + * @param string|array|null $key + * @return array|null */ public function mode($key = null) { @@ -159,7 +189,7 @@ public function mode($key = null) /** * Collapse the collection of items into a single array. * - * @return static + * @return static */ public function collapse() { @@ -177,7 +207,7 @@ public function collapse() /** * 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 @@ public function contains($key, $operator = null, $value = null) if (func_num_args() === 1 && $this->useAsCallable($key)) { $placeholder = new stdClass; + /** @var callable $key */ return $this->first($key, $placeholder) !== $placeholder; } @@ -205,11 +236,27 @@ public function contains($key, $operator = null, $value = null) return $this->contains($this->operatorForWhere(...func_get_args())); } + /** + * Determine if an item is not contained in the enumerable. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null) + { + return ! $this->contains(...func_get_args()); + } + /** * Cross join the given iterables, returning all possible permutations. * - * @param array ...$arrays - * @return static + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$arrays + * @return static> */ public function crossJoin(...$arrays) { @@ -219,8 +266,8 @@ public function crossJoin(...$arrays) /** * 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): mixed)|string|null $countBy + * @return static */ public function countBy($countBy = null) { @@ -248,7 +295,7 @@ public function countBy($countBy = null) /** * Get the items that are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diff($items) @@ -259,8 +306,8 @@ public function diff($items) /** * Get the items that are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback * @return static */ public function diffUsing($items, callable $callback) @@ -271,7 +318,7 @@ public function diffUsing($items, callable $callback) /** * Get the items whose keys and values are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffAssoc($items) @@ -282,8 +329,8 @@ public function diffAssoc($items) /** * Get the items whose keys and values are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffAssocUsing($items, callable $callback) @@ -294,7 +341,7 @@ public function diffAssocUsing($items, callable $callback) /** * Get the items whose keys are not present in the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function diffKeys($items) @@ -305,8 +352,8 @@ public function diffKeys($items) /** * Get the items whose keys are not present in the given items, using the callback. * - * @param mixed $items - * @param callable $callback + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback * @return static */ public function diffKeysUsing($items, callable $callback) @@ -317,7 +364,7 @@ public function diffKeysUsing($items, callable $callback) /** * Retrieve duplicate items. * - * @param callable|string|null $callback + * @param (callable(TValue): bool)|string|null $callback * @param bool $strict * @return static */ @@ -329,7 +376,7 @@ public function duplicates($callback = null, $strict = false) /** * 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) @@ -340,7 +387,7 @@ public function duplicatesStrict($callback = null) /** * Get all items except for those with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array $keys * @return static */ public function except($keys) @@ -351,7 +398,7 @@ public function except($keys) /** * 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) @@ -374,9 +421,11 @@ public function filter(callable $callback = null) /** * 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) { @@ -403,7 +452,7 @@ public function first(callable $callback = null, $default = null) * Get a flattened list of the items in the collection. * * @param int $depth - * @return static + * @return static */ public function flatten($depth = INF) { @@ -425,7 +474,7 @@ public function flatten($depth = INF) /** * Flip the items in the collection. * - * @return static + * @return static */ public function flip() { @@ -439,9 +488,11 @@ public function flip() /** * 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) { @@ -461,9 +512,9 @@ 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> */ public function groupBy($groupBy, $preserveKeys = false) { @@ -473,8 +524,8 @@ 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 */ public function keyBy($keyBy) { @@ -535,7 +586,7 @@ public function hasAny($key) /** * Concatenate values of a given key as a string. * - * @param string $value + * @param callable|string $value * @param string|null $glue * @return string */ @@ -547,7 +598,7 @@ public function implode($value, $glue = null) /** * Intersect the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersect($items) @@ -558,7 +609,7 @@ public function intersect($items) /** * Intersect the collection with the given items by key. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function intersectByKeys($items) @@ -601,7 +652,7 @@ public function join($glue, $finalGlue = '') /** * Get the keys of the collection items. * - * @return static + * @return static */ public function keys() { @@ -615,9 +666,11 @@ 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) { @@ -635,9 +688,9 @@ public function last(callable $callback = null, $default = null) /** * Get the values of a given key. * - * @param string|array $value + * @param string|array $value * @param string|null $key - * @return static + * @return static */ public function pluck($value, $key = null) { @@ -665,8 +718,10 @@ public function pluck($value, $key = null) /** * Run a map over each of the items. * - * @param callable $callback - * @return static + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static */ public function map(callable $callback) { @@ -682,8 +737,11 @@ public function map(callable $callback) * * 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 $callback + * @return static> */ public function mapToDictionary(callable $callback) { @@ -695,8 +753,11 @@ public function mapToDictionary(callable $callback) * * 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 $callback + * @return static */ public function mapWithKeys(callable $callback) { @@ -710,7 +771,7 @@ public function mapWithKeys(callable $callback) /** * Merge the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function merge($items) @@ -721,8 +782,10 @@ public function merge($items) /** * Recursively merge the collection with the given items. * - * @param mixed $items - * @return static + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static */ public function mergeRecursive($items) { @@ -732,8 +795,10 @@ 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 \IteratorAggregate|array|(callable(): \Generator) $values + * @return static */ public function combine($values) { @@ -763,7 +828,7 @@ public function combine($values) /** * Union the collection with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function union($items) @@ -783,8 +848,8 @@ public function nth($step, $offset = 0) 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; } @@ -796,7 +861,7 @@ public function nth($step, $offset = 0) /** * Get the items with the specified keys. * - * @param mixed $keys + * @param \Illuminate\Support\Enumerable|array|string $keys * @return static */ public function only($keys) @@ -831,7 +896,7 @@ public function only($keys) /** * Push all of the given items onto the collection. * - * @param iterable $source + * @param iterable $source * @return static */ public function concat($source) @@ -846,7 +911,7 @@ public function concat($source) * Get one or a specified number of items randomly from the collection. * * @param int|null $number - * @return static|mixed + * @return static|TValue * * @throws \InvalidArgumentException */ @@ -860,7 +925,7 @@ public function random($number = null) /** * Replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replace($items) @@ -887,7 +952,7 @@ public function replace($items) /** * Recursively replace the collection items with the given items. * - * @param mixed $items + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items * @return static */ public function replaceRecursive($items) @@ -908,12 +973,13 @@ public function reverse() /** * 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) { @@ -945,7 +1011,7 @@ public function shuffle($seed = null) * * @param int $size * @param int $step - * @return static + * @return static */ public function sliding($size = 2, $step = 1) { @@ -958,7 +1024,7 @@ public function sliding($size = 2, $step = 1) $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); }); @@ -1005,7 +1071,7 @@ public function skip($count) /** * 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) @@ -1018,7 +1084,7 @@ public function skipUntil($value) /** * 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) @@ -1062,7 +1128,7 @@ public function slice($offset, $length = null) * Split a collection into a certain number of groups. * * @param int $numberOfGroups - * @return static + * @return static */ public function split($numberOfGroups) { @@ -1072,10 +1138,10 @@ public function split($numberOfGroups) /** * 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 \Illuminate\Support\ItemNotFoundException * @throws \Illuminate\Support\MultipleItemsFoundException @@ -1087,7 +1153,7 @@ public function sole($key = null, $operator = null, $value = null) : $key; return $this - ->when($filter) + ->unless($filter == null) ->filter($filter) ->take(2) ->collect() @@ -1097,10 +1163,10 @@ 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 mixed $key + * @param (callable(TValue, TKey): bool)|string $key * @param mixed $operator * @param mixed $value - * @return mixed + * @return TValue * * @throws \Illuminate\Support\ItemNotFoundException */ @@ -1111,7 +1177,7 @@ public function firstOrFail($key = null, $operator = null, $value = null) : $key; return $this - ->when($filter) + ->unless($filter == null) ->filter($filter) ->take(1) ->collect() @@ -1122,7 +1188,7 @@ 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 */ public function chunk($size) { @@ -1161,7 +1227,7 @@ public function chunk($size) * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups - * @return static + * @return static */ public function splitIn($numberOfGroups) { @@ -1171,8 +1237,8 @@ public function splitIn($numberOfGroups) /** * Chunk the collection into chunks with a callback. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey, Collection): bool $callback + * @return static> */ public function chunkWhile(callable $callback) { @@ -1208,7 +1274,7 @@ public function chunkWhile(callable $callback) /** * 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) @@ -1230,7 +1296,7 @@ public function sortDesc($options = SORT_REGULAR) /** * Sort the collection using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @param bool $descending * @return static @@ -1243,7 +1309,7 @@ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) /** * Sort the collection in descending order using the given callback. * - * @param callable|string $callback + * @param array|(callable(TValue, TKey): mixed)|string $callback * @param int $options * @return static */ @@ -1275,6 +1341,17 @@ public function sortKeysDesc($options = SORT_REGULAR) return $this->passthru('sortKeysDesc', func_get_args()); } + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + return $this->passthru('sortKeysUsing', func_get_args()); + } + /** * Take the first or last {$limit} items. * @@ -1307,11 +1384,12 @@ public function take($limit) /** * 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) { @@ -1335,19 +1413,30 @@ public function takeUntilTimeout(DateTimeInterface $timeout) { $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) { @@ -1358,7 +1447,7 @@ public function takeWhile($value) /** * 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) @@ -1385,7 +1474,7 @@ 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 */ @@ -1409,7 +1498,7 @@ public function unique($key = null, $strict = false) /** * Reset the keys on the underlying array. * - * @return static + * @return static */ public function values() { @@ -1426,8 +1515,10 @@ public function values() * 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 \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> */ public function zip($items) { @@ -1449,9 +1540,11 @@ public function zip($items) /** * Pad collection to the specified length with a value. * + * @template TPadValue + * * @param int $size - * @param mixed $value - * @return static + * @param TPadValue $value + * @return static */ public function pad($size, $value) { @@ -1477,10 +1570,9 @@ public function pad($size, $value) /** * Get the values iterator. * - * @return \Traversable + * @return \Traversable */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return $this->makeIterator($this->source); } @@ -1490,8 +1582,7 @@ public function getIterator() * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { if (is_array($this->source)) { return count($this->source); @@ -1503,8 +1594,11 @@ public function count() /** * Make an iterator from the given source. * - * @param mixed $source - * @return \Traversable + * @template TIteratorKey of array-key + * @template TIteratorValue + * + * @param \IteratorAggregate|array|(callable(): \Generator) $source + * @return \Traversable */ protected function makeIterator($source) { @@ -1522,9 +1616,9 @@ protected function makeIterator($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) { @@ -1539,7 +1633,7 @@ protected function explodePluckParameters($value, $key) * Pass this lazy collection through a method on the collection class. * * @param string $method - * @param array $params + * @param array $params * @return static */ protected function passthru($method, array $params) diff --git a/vendor/illuminate/collections/MultipleItemsFoundException.php b/vendor/illuminate/collections/MultipleItemsFoundException.php index 944b2dc..d90d835 100644 --- a/vendor/illuminate/collections/MultipleItemsFoundException.php +++ b/vendor/illuminate/collections/MultipleItemsFoundException.php @@ -6,4 +6,35 @@ class MultipleItemsFoundException extends RuntimeException { + /** + * The number of items found. + * + * @var int + */ + public $count; + + /** + * Create a new exception instance. + * + * @param int $count + * @param int $code + * @param \Throwable|null $previous + * @return void + */ + public function __construct($count, $code = 0, $previous = null) + { + $this->count = $count; + + parent::__construct("$count items were found.", $code, $previous); + } + + /** + * Get the number of items found. + * + * @return int + */ + public function getCount() + { + return $this->count; + } } diff --git a/vendor/illuminate/collections/Traits/EnumeratesValues.php b/vendor/illuminate/collections/Traits/EnumeratesValues.php index 9eb31ea..1e2f9ae 100644 --- a/vendor/illuminate/collections/Traits/EnumeratesValues.php +++ b/vendor/illuminate/collections/Traits/EnumeratesValues.php @@ -11,16 +11,20 @@ use Illuminate\Support\Collection; use Illuminate\Support\Enumerable; use Illuminate\Support\HigherOrderCollectionProxy; -use Illuminate\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 + * @property-read HigherOrderCollectionProxy $doesntContain * @property-read HigherOrderCollectionProxy $each * @property-read HigherOrderCollectionProxy $every * @property-read HigherOrderCollectionProxy $filter @@ -33,19 +37,23 @@ * @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. * @@ -56,12 +64,13 @@ trait EnumeratesValues /** * The methods that can be proxied. * - * @var string[] + * @var array */ protected static $proxies = [ 'average', 'avg', 'contains', + 'doesntContain', 'each', 'every', 'filter', @@ -83,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 \Illuminate\Contracts\Support\Arrayable|iterable|null $items + * @return static */ public static function make($items = []) { @@ -100,8 +114,11 @@ public static function make($items = []) /** * Wrap the given value in a collection if applicable. * - * @param mixed $value - * @return static + * @template TWrapKey of array-key + * @template TWrapValue + * + * @param iterable $value + * @return static */ public static function wrap($value) { @@ -113,8 +130,11 @@ 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|static $value + * @return array */ public static function unwrap($value) { @@ -134,9 +154,11 @@ public static function empty() /** * 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 */ public static function times($number, callable $callback = null) { @@ -145,15 +167,15 @@ public static function times($number, callable $callback = null) } 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) { @@ -163,7 +185,7 @@ public function average($callback = null) /** * Alias for the "contains" method. * - * @param mixed $key + * @param (callable(TValue, TKey): bool)|TValue|string $key * @param mixed $operator * @param mixed $value * @return bool @@ -176,8 +198,8 @@ public function some($key, $operator = null, $value = null) /** * 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) @@ -205,7 +227,7 @@ public function containsStrict($key, $value = null) * Dump the items and end the script. * * @param mixed ...$args - * @return void + * @return never */ public function dd(...$args) { @@ -233,7 +255,7 @@ public function dump() /** * Execute a callback over each item. * - * @param callable $callback + * @param callable(TValue, TKey): mixed $callback * @return $this */ public function each(callable $callback) @@ -250,7 +272,7 @@ public function each(callable $callback) /** * Execute a callback over each nested chunk of items. * - * @param callable $callback + * @param callable(...mixed): mixed $callback * @return static */ public function eachSpread(callable $callback) @@ -265,7 +287,7 @@ public function eachSpread(callable $callback) /** * 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 @@ -290,16 +312,32 @@ public function every($key, $operator = null, $value = null) /** * 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. * @@ -313,8 +351,10 @@ public function isNotEmpty() /** * Run a map over each nested chunk of items. * - * @param callable $callback - * @return static + * @template TMapSpreadValue + * + * @param callable(mixed): TMapSpreadValue $callback + * @return static */ public function mapSpread(callable $callback) { @@ -330,8 +370,11 @@ public function mapSpread(callable $callback) * * 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 $callback + * @return static> */ public function mapToGroups(callable $callback) { @@ -343,8 +386,8 @@ public function mapToGroups(callable $callback) /** * Map a collection and flatten the result by a single level. * - * @param callable $callback - * @return static + * @param callable(TValue, TKey): mixed $callback + * @return static */ public function flatMap(callable $callback) { @@ -354,8 +397,10 @@ public function flatMap(callable $callback) /** * Map the values into a new class. * - * @param string $class - * @return static + * @template TMapIntoValue + * + * @param class-string $class + * @return static */ public function mapInto($class) { @@ -367,8 +412,8 @@ public function mapInto($class) /** * Get the min value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function min($callback = null) { @@ -386,8 +431,8 @@ public function min($callback = null) /** * Get the max value of a given key. * - * @param callable|string|null $callback - * @return mixed + * @param (callable(TValue):mixed)|string|null $callback + * @return TValue */ public function max($callback = null) { @@ -419,10 +464,10 @@ public function forPage($page, $perPage) /** * 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, static> */ public function partition($key, $operator = null, $value = null) { @@ -447,7 +492,7 @@ public function partition($key, $operator = null, $value = null) /** * 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) @@ -461,35 +506,14 @@ public function sum($callback = null) }, 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; - } - /** * 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) { @@ -499,34 +523,25 @@ 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) { 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) { @@ -536,9 +551,11 @@ 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) { @@ -548,7 +565,7 @@ public function unlessNotEmpty(callable $callback, callable $default = null) /** * Filter items by the given key value pair. * - * @param string $key + * @param callable|string $key * @param mixed $operator * @param mixed $value * @return static @@ -596,7 +613,7 @@ public function whereStrict($key, $value) * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -613,7 +630,7 @@ public function whereIn($key, $values, $strict = false) * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereInStrict($key, $values) @@ -625,7 +642,7 @@ public function whereInStrict($key, $values) * Filter items such that the value of the given key is between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereBetween($key, $values) @@ -637,7 +654,7 @@ public function whereBetween($key, $values) * Filter items such that the value of the given key is not between the given values. * * @param string $key - * @param array $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotBetween($key, $values) @@ -651,7 +668,7 @@ public function whereNotBetween($key, $values) * Filter items by the given key value pair. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @param bool $strict * @return static */ @@ -668,7 +685,7 @@ public function whereNotIn($key, $values, $strict = false) * Filter items by the given key value pair using strict comparison. * * @param string $key - * @param mixed $values + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values * @return static */ public function whereNotInStrict($key, $values) @@ -679,8 +696,10 @@ public function whereNotInStrict($key, $values) /** * 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|array> $type + * @return static */ public function whereInstanceOf($type) { @@ -702,8 +721,10 @@ public function whereInstanceOf($type) /** * 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) { @@ -713,7 +734,7 @@ public function pipe(callable $callback) /** * Pass the collection into a new class. * - * @param string $class + * @param class-string $class * @return mixed */ public function pipeInto($class) @@ -722,24 +743,30 @@ public function pipeInto($class) } /** - * Pass the collection to the given callback and then return it. + * Pass the collection through a series of callable pipes and return the result. * - * @param callable $callback - * @return $this + * @param array $callbacks + * @return mixed */ - public function tap(callable $callback) + public function pipeThrough($callbacks) { - $callback(clone $this); - - return $this; + return Collection::make($callbacks)->reduce( + function ($carry, $callback) { + return $callback($carry); + }, + $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) { @@ -752,22 +779,6 @@ public function reduce(callable $callback, $initial = null) 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. * @@ -786,7 +797,7 @@ public function reduceSpread(callable $callback, ...$initial) 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) )); } @@ -795,22 +806,10 @@ class_basename(static::class), gettype($result) 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 $callback * @return static */ public function reject($callback = true) @@ -824,10 +823,45 @@ public function reject($callback = true) }); } + /** + * 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) @@ -838,7 +872,7 @@ public function uniqueStrict($key = null) /** * Collect the values into a collection. * - * @return \Illuminate\Support\Collection + * @return \Illuminate\Support\Collection */ public function collect() { @@ -848,7 +882,7 @@ public function collect() /** * Get the collection of items as a plain array. * - * @return array + * @return array */ public function toArray() { @@ -860,10 +894,9 @@ public function toArray() /** * Convert the object into something JSON serializable. * - * @return array + * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return array_map(function ($value) { if ($value instanceof JsonSerializable) { @@ -957,7 +990,7 @@ public function __get($key) * Results array of items from Collection or Arrayable. * * @param mixed $items - * @return array + * @return array */ protected function getArrayableItems($items) { @@ -973,6 +1006,8 @@ protected function getArrayableItems($items) return (array) $items->jsonSerialize(); } elseif ($items instanceof Traversable) { return iterator_to_array($items); + } elseif ($items instanceof UnitEnum) { + return [$items]; } return (array) $items; @@ -981,13 +1016,17 @@ protected function getArrayableItems($items) /** * 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; @@ -1059,7 +1098,7 @@ protected function valueRetriever($value) * Make a function to check an item's equality. * * @param mixed $value - * @return \Closure + * @return \Closure(mixed): bool */ protected function equality($value) { @@ -1084,7 +1123,7 @@ protected function negate(Closure $callback) /** * Make a function that returns what's passed to it. * - * @return \Closure + * @return \Closure(TValue): TValue */ protected function identity() { diff --git a/vendor/illuminate/collections/composer.json b/vendor/illuminate/collections/composer.json index ecc4537..cc9aad3 100644 --- a/vendor/illuminate/collections/composer.json +++ b/vendor/illuminate/collections/composer.json @@ -14,9 +14,10 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0" + "php": "^8.0.2", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0" }, "autoload": { "psr-4": { @@ -28,11 +29,11 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { - "symfony/var-dumper": "Required to use the dump method (^5.4)." + "symfony/var-dumper": "Required to use the dump method (^6.0)." }, "config": { "sort-packages": true diff --git a/vendor/illuminate/collections/helpers.php b/vendor/illuminate/collections/helpers.php index 67669e5..45fc6d4 100644 --- a/vendor/illuminate/collections/helpers.php +++ b/vendor/illuminate/collections/helpers.php @@ -7,8 +7,11 @@ /** * Create a collection from the given value. * - * @param mixed $value - * @return \Illuminate\Support\Collection + * @template TKey of array-key + * @template TValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $value + * @return \Illuminate\Support\Collection */ function collect($value = null) { @@ -58,7 +61,7 @@ function data_get($target, $key, $default = null) if ($segment === '*') { if ($target instanceof Collection) { $target = $target->all(); - } elseif (! is_array($target)) { + } elseif (! is_iterable($target)) { return value($default); } diff --git a/vendor/illuminate/collections/HigherOrderWhenProxy.php b/vendor/illuminate/conditionable/HigherOrderWhenProxy.php similarity index 54% rename from vendor/illuminate/collections/HigherOrderWhenProxy.php rename to vendor/illuminate/conditionable/HigherOrderWhenProxy.php index 6653c03..173a783 100644 --- a/vendor/illuminate/collections/HigherOrderWhenProxy.php +++ b/vendor/illuminate/conditionable/HigherOrderWhenProxy.php @@ -2,17 +2,14 @@ namespace Illuminate\Support; -/** - * @mixin \Illuminate\Support\Enumerable - */ class HigherOrderWhenProxy { /** - * The collection being operated on. + * The target being conditionally operated on. * - * @var \Illuminate\Support\Enumerable + * @var mixed */ - protected $collection; + protected $target; /** * The condition for proxying. @@ -24,18 +21,18 @@ class HigherOrderWhenProxy /** * Create a new proxy instance. * - * @param \Illuminate\Support\Enumerable $collection + * @param mixed $target * @param bool $condition * @return void */ - public function __construct(Enumerable $collection, $condition) + public function __construct($target, $condition) { + $this->target = $target; $this->condition = $condition; - $this->collection = $collection; } /** - * Proxy accessing an attribute onto the collection. + * Proxy accessing an attribute onto the target. * * @param string $key * @return mixed @@ -43,12 +40,12 @@ public function __construct(Enumerable $collection, $condition) public function __get($key) { return $this->condition - ? $this->collection->{$key} - : $this->collection; + ? $this->target->{$key} + : $this->target; } /** - * Proxy a method call onto the collection. + * Proxy a method call on the target. * * @param string $method * @param array $parameters @@ -57,7 +54,7 @@ public function __get($key) public function __call($method, $parameters) { return $this->condition - ? $this->collection->{$method}(...$parameters) - : $this->collection; + ? $this->target->{$method}(...$parameters) + : $this->target; } } diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/vendor/illuminate/conditionable/LICENSE.md similarity index 83% rename from vendor/symfony/deprecation-contracts/LICENSE rename to vendor/illuminate/conditionable/LICENSE.md index ad85e17..79810c8 100644 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ b/vendor/illuminate/conditionable/LICENSE.md @@ -1,14 +1,16 @@ -Copyright (c) 2020-2021 Fabien Potencier +The MIT License (MIT) + +Copyright (c) Taylor Otwell Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, diff --git a/vendor/illuminate/conditionable/Traits/Conditionable.php b/vendor/illuminate/conditionable/Traits/Conditionable.php new file mode 100644 index 0000000..7ab08ca --- /dev/null +++ b/vendor/illuminate/conditionable/Traits/Conditionable.php @@ -0,0 +1,65 @@ +isVariadic()) { + $variadicDependencies = $container->make($className); + + $dependencies = array_merge($dependencies, is_array($variadicDependencies) + ? $variadicDependencies + : [$variadicDependencies]); } else { $dependencies[] = $container->make($className); } @@ -191,6 +197,6 @@ protected static function addDependencyForCallParameter($container, $parameter, */ protected static function isCallableWithAtSign($callback) { - return is_string($callback) && strpos($callback, '@') !== false; + return is_string($callback) && str_contains($callback, '@'); } } diff --git a/vendor/illuminate/container/Container.php b/vendor/illuminate/container/Container.php index bf7bb8e..45d1b50 100644 --- a/vendor/illuminate/container/Container.php +++ b/vendor/illuminate/container/Container.php @@ -191,7 +191,7 @@ public function bound($abstract) * * @return bool */ - public function has($id) + public function has(string $id): bool { return $this->bound($id); } @@ -426,9 +426,7 @@ public function scoped($abstract, $concrete = null) public function scopedIf($abstract, $concrete = null) { if (! $this->bound($abstract)) { - $this->scopedInstances[] = $abstract; - - $this->singleton($abstract, $concrete); + $this->scoped($abstract, $concrete); } } @@ -609,7 +607,7 @@ protected function rebound($abstract) $instance = $this->make($abstract); foreach ($this->getReboundCallbacks($abstract) as $callback) { - call_user_func($callback, $this, $instance); + $callback($this, $instance); } } @@ -699,7 +697,7 @@ public function make($abstract, array $parameters = []) * * @return mixed */ - public function get($id) + public function get(string $id) { try { return $this->resolve($id); @@ -708,7 +706,7 @@ public function get($id) throw $e; } - throw new EntryNotFoundException($id, $e->getCode(), $e); + throw new EntryNotFoundException($id, is_int($e->getCode()) ? $e->getCode() : 0, $e); } } @@ -886,10 +884,6 @@ public function build($concrete) return $this->notInstantiable($concrete); } - // if (in_array($concrete, $this->buildStack)) { - // throw new CircularDependencyException("Circular dependency detected while resolving [{$concrete}]."); - // } - $this->buildStack[] = $concrete; $constructor = $reflector->getConstructor(); @@ -1005,7 +999,7 @@ protected function getLastParameterOverride() protected function resolvePrimitive(ReflectionParameter $parameter) { if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->getName()))) { - return $concrete instanceof Closure ? $concrete($this) : $concrete; + return Util::unwrapIfClosure($concrete, $this); } if ($parameter->isDefaultValueAvailable()) { @@ -1405,8 +1399,7 @@ public static function setInstance(ContainerContract $container = null) * @param string $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return $this->bound($key); } @@ -1417,8 +1410,7 @@ public function offsetExists($key) * @param string $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->make($key); } @@ -1430,8 +1422,7 @@ public function offsetGet($key) * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { $this->bind($key, $value instanceof Closure ? $value : function () use ($value) { return $value; @@ -1444,8 +1435,7 @@ public function offsetSet($key, $value) * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]); } diff --git a/vendor/illuminate/container/ContextualBindingBuilder.php b/vendor/illuminate/container/ContextualBindingBuilder.php index 1d15dcd..707b74c 100644 --- a/vendor/illuminate/container/ContextualBindingBuilder.php +++ b/vendor/illuminate/container/ContextualBindingBuilder.php @@ -86,13 +86,11 @@ public function giveTagged($tag) * 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) { - $this->give(function ($container) use ($key, $default) { - return $container->get('config')->get($key, $default); - }); + $this->give(fn ($container) => $container->get('config')->get($key, $default)); } } diff --git a/vendor/illuminate/container/RewindableGenerator.php b/vendor/illuminate/container/RewindableGenerator.php index 4ee7bb2..14c0bd0 100644 --- a/vendor/illuminate/container/RewindableGenerator.php +++ b/vendor/illuminate/container/RewindableGenerator.php @@ -4,6 +4,7 @@ use Countable; use IteratorAggregate; +use Traversable; class RewindableGenerator implements Countable, IteratorAggregate { @@ -37,10 +38,9 @@ public function __construct(callable $generator, $count) /** * Get an iterator from the generator. * - * @return mixed + * @return \Traversable */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return ($this->generator)(); } @@ -50,8 +50,7 @@ public function getIterator() * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { if (is_callable($count = $this->count)) { $this->count = $count(); diff --git a/vendor/illuminate/container/Util.php b/vendor/illuminate/container/Util.php index 8f7e917..8d5023b 100644 --- a/vendor/illuminate/container/Util.php +++ b/vendor/illuminate/container/Util.php @@ -33,11 +33,12 @@ public static function arrayWrap($value) * From global value() helper in Illuminate\Support. * * @param mixed $value + * @param mixed ...$args * @return mixed */ - public static function unwrapIfClosure($value) + public static function unwrapIfClosure($value, ...$args) { - return $value instanceof Closure ? $value() : $value; + return $value instanceof Closure ? $value(...$args) : $value; } /** diff --git a/vendor/illuminate/container/composer.json b/vendor/illuminate/container/composer.json index cf93160..8944b5b 100644 --- a/vendor/illuminate/container/composer.json +++ b/vendor/illuminate/container/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/contracts": "^8.0", - "psr/container": "^1.0" + "php": "^8.0.2", + "illuminate/contracts": "^9.0", + "psr/container": "^1.1.1|^2.0.1" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.1|2.0" }, "autoload": { "psr-4": { @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/illuminate/contracts/Auth/Guard.php b/vendor/illuminate/contracts/Auth/Guard.php index 2a27fb5..2796f1a 100644 --- a/vendor/illuminate/contracts/Auth/Guard.php +++ b/vendor/illuminate/contracts/Auth/Guard.php @@ -40,6 +40,13 @@ public function id(); */ public function validate(array $credentials = []); + /** + * Determine if the guard has a user instance. + * + * @return bool + */ + public function hasUser(); + /** * Set the current user. * diff --git a/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php b/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php index 47b1c08..683a903 100644 --- a/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php +++ b/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php @@ -8,7 +8,7 @@ interface PasswordBrokerFactory * Get a password broker instance by name. * * @param string|null $name - * @return mixed + * @return \Illuminate\Contracts\Auth\PasswordBroker */ public function broker($name = null); } diff --git a/vendor/illuminate/contracts/Broadcasting/Broadcaster.php b/vendor/illuminate/contracts/Broadcasting/Broadcaster.php index 1034e44..2d317d0 100644 --- a/vendor/illuminate/contracts/Broadcasting/Broadcaster.php +++ b/vendor/illuminate/contracts/Broadcasting/Broadcaster.php @@ -28,6 +28,8 @@ public function validAuthenticationResponse($request, $result); * @param string $event * @param array $payload * @return void + * + * @throws \Illuminate\Broadcasting\BroadcastException */ public function broadcast(array $channels, $event, array $payload = []); } diff --git a/vendor/illuminate/contracts/Container/Container.php b/vendor/illuminate/contracts/Container/Container.php index 1b8bb64..7d7f2c9 100644 --- a/vendor/illuminate/contracts/Container/Container.php +++ b/vendor/illuminate/contracts/Container/Container.php @@ -81,6 +81,24 @@ public function singleton($abstract, $concrete = null); */ public function singletonIf($abstract, $concrete = null); + /** + * Register a scoped binding in the container. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function scoped($abstract, $concrete = null); + + /** + * Register a scoped binding if it hasn't already been registered. + * + * @param string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function scopedIf($abstract, $concrete = null); + /** * "Extend" an abstract type in the container. * @@ -163,6 +181,15 @@ public function call($callback, array $parameters = [], $defaultMethod = null); */ public function resolved($abstract); + /** + * Register a new before resolving callback. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + */ + public function beforeResolving($abstract, Closure $callback = null); + /** * Register a new resolving callback. * diff --git a/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php b/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php index 149e7b2..1d84ef8 100644 --- a/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php +++ b/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php @@ -27,4 +27,13 @@ public function give($implementation); * @return void */ public function giveTagged($tag); + + /** + * Specify the configuration item to bind as a primitive. + * + * @param string $key + * @param mixed $default + * @return void + */ + public function giveConfig($key, $default = null); } diff --git a/vendor/illuminate/contracts/Database/Eloquent/Builder.php b/vendor/illuminate/contracts/Database/Eloquent/Builder.php new file mode 100644 index 0000000..6fdf405 --- /dev/null +++ b/vendor/illuminate/contracts/Database/Eloquent/Builder.php @@ -0,0 +1,14 @@ + */ public function getQueueableIds(); /** * Get the relationships of the entities being queued. * - * @return array + * @return array */ public function getQueueableRelations(); diff --git a/vendor/illuminate/contracts/Routing/UrlGenerator.php b/vendor/illuminate/contracts/Routing/UrlGenerator.php index e576dda..cca221c 100644 --- a/vendor/illuminate/contracts/Routing/UrlGenerator.php +++ b/vendor/illuminate/contracts/Routing/UrlGenerator.php @@ -69,6 +69,13 @@ public function route($name, $parameters = [], $absolute = true); */ public function action($action, $parameters = [], $absolute = true); + /** + * Get the root controller namespace. + * + * @return string + */ + public function getRootControllerNamespace(); + /** * Set the root controller namespace. * diff --git a/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php b/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php new file mode 100644 index 0000000..113f420 --- /dev/null +++ b/vendor/illuminate/contracts/Session/Middleware/AuthenticatesSessions.php @@ -0,0 +1,8 @@ + */ public function toArray(); } diff --git a/vendor/illuminate/contracts/Validation/InvokableRule.php b/vendor/illuminate/contracts/Validation/InvokableRule.php new file mode 100644 index 0000000..b703309 --- /dev/null +++ b/vendor/illuminate/contracts/Validation/InvokableRule.php @@ -0,0 +1,16 @@ +setupWildcardListen($event, $listener); } else { - $this->listeners[$event][] = $this->makeListener($listener); + $this->listeners[$event][] = $listener; } } } @@ -108,7 +108,7 @@ public function listen($events, $listener = null) */ protected function setupWildcardListen($event, $listener) { - $this->wildcards[$event][] = $this->makeListener($listener, true); + $this->wildcards[$event][] = $listener; $this->wildcardsCache = []; } @@ -147,7 +147,7 @@ public function hasWildcardListeners($eventName) * Register an event and payload to be fired later. * * @param string $event - * @param array $payload + * @param object|array $payload * @return void */ public function push($event, $payload = []) @@ -328,10 +328,8 @@ protected function broadcastEvent($event) */ public function getListeners($eventName) { - $listeners = $this->listeners[$eventName] ?? []; - $listeners = array_merge( - $listeners, + $this->prepareListeners($eventName), $this->wildcardsCache[$eventName] ?? $this->getWildcardListeners($eventName) ); @@ -352,7 +350,9 @@ protected function getWildcardListeners($eventName) foreach ($this->wildcards as $key => $listeners) { if (Str::is($key, $eventName)) { - $wildcards = array_merge($wildcards, $listeners); + foreach ($listeners as $listener) { + $wildcards[] = $this->makeListener($listener, true); + } } } @@ -370,7 +370,7 @@ protected function addInterfaceListeners($eventName, array $listeners = []) { foreach (class_implements($eventName) as $interface) { if (isset($this->listeners[$interface])) { - foreach ($this->listeners[$interface] as $names) { + foreach ($this->prepareListeners($interface) as $names) { $listeners = array_merge($listeners, (array) $names); } } @@ -379,6 +379,23 @@ protected function addInterfaceListeners($eventName, array $listeners = []) return $listeners; } + /** + * Prepare the listeners for a given event. + * + * @param string $eventName + * @return \Closure[] + */ + protected function prepareListeners(string $eventName) + { + $listeners = []; + + foreach ($this->listeners[$eventName] ?? [] as $listener) { + $listeners[] = $this->makeListener($listener); + } + + return $listeners; + } + /** * Register an event listener with the dispatcher. * @@ -595,22 +612,24 @@ protected function createListenerAndJob($class, $method, $arguments) * Propagate listener options to the job. * * @param mixed $listener - * @param mixed $job + * @param \Illuminate\Events\CallQueuedListener $job * @return mixed */ protected function propagateListenerOptions($listener, $job) { return tap($job, function ($job) use ($listener) { + $data = array_values($job->data); + $job->afterCommit = property_exists($listener, 'afterCommit') ? $listener->afterCommit : null; - $job->backoff = method_exists($listener, 'backoff') ? $listener->backoff() : ($listener->backoff ?? null); + $job->backoff = method_exists($listener, 'backoff') ? $listener->backoff(...$data) : ($listener->backoff ?? null); $job->maxExceptions = $listener->maxExceptions ?? null; - $job->retryUntil = method_exists($listener, 'retryUntil') ? $listener->retryUntil() : null; + $job->retryUntil = method_exists($listener, 'retryUntil') ? $listener->retryUntil(...$data) : null; $job->shouldBeEncrypted = $listener instanceof ShouldBeEncrypted; $job->timeout = $listener->timeout ?? null; $job->tries = $listener->tries ?? null; $job->through(array_merge( - method_exists($listener, 'middleware') ? $listener->middleware() : [], + method_exists($listener, 'middleware') ? $listener->middleware(...$data) : [], $listener->middleware ?? [] )); }); @@ -624,7 +643,7 @@ protected function propagateListenerOptions($listener, $job) */ public function forget($event) { - if (Str::contains($event, '*')) { + if (str_contains($event, '*')) { unset($this->wildcards[$event]); } else { unset($this->listeners[$event]); @@ -645,7 +664,7 @@ public function forget($event) public function forgetPushed() { foreach ($this->listeners as $key => $value) { - if (Str::endsWith($key, '_pushed')) { + if (str_ends_with($key, '_pushed')) { $this->forget($key); } } @@ -673,4 +692,14 @@ public function setQueueResolver(callable $resolver) return $this; } + + /** + * Gets the raw, unprepared listeners. + * + * @return array + */ + public function getRawListeners() + { + return $this->listeners; + } } diff --git a/vendor/illuminate/events/NullDispatcher.php b/vendor/illuminate/events/NullDispatcher.php index 5c539d5..3164fbb 100644 --- a/vendor/illuminate/events/NullDispatcher.php +++ b/vendor/illuminate/events/NullDispatcher.php @@ -139,6 +139,6 @@ public function forgetPushed() */ public function __call($method, $parameters) { - return $this->forwardCallTo($this->dispatcher, $method, $parameters); + return $this->forwardDecoratedCallTo($this->dispatcher, $method, $parameters); } } diff --git a/vendor/illuminate/events/QueuedClosure.php b/vendor/illuminate/events/QueuedClosure.php index 8259059..31a462a 100644 --- a/vendor/illuminate/events/QueuedClosure.php +++ b/vendor/illuminate/events/QueuedClosure.php @@ -3,7 +3,7 @@ namespace Illuminate\Events; use Closure; -use Illuminate\Queue\SerializableClosureFactory; +use Laravel\SerializableClosure\SerializableClosure; class QueuedClosure { @@ -80,7 +80,7 @@ public function onQueue($queue) } /** - * Set the desired delay for the job. + * Set the desired delay in seconds for the job. * * @param \DateTimeInterface|\DateInterval|int|null $delay * @return $this @@ -114,10 +114,10 @@ public function resolve() { return function (...$arguments) { dispatch(new CallQueuedListener(InvokeQueuedClosure::class, 'handle', [ - 'closure' => SerializableClosureFactory::make($this->closure), + 'closure' => new SerializableClosure($this->closure), 'arguments' => $arguments, 'catch' => collect($this->catchCallbacks)->map(function ($callback) { - return SerializableClosureFactory::make($callback); + return new SerializableClosure($callback); })->all(), ]))->onConnection($this->connection)->onQueue($this->queue)->delay($this->delay); }; diff --git a/vendor/illuminate/events/composer.json b/vendor/illuminate/events/composer.json index b77ba2c..d074212 100644 --- a/vendor/illuminate/events/composer.json +++ b/vendor/illuminate/events/composer.json @@ -14,13 +14,13 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/bus": "^8.0", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0" + "php": "^8.0.2", + "illuminate/bus": "^9.0", + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0" }, "autoload": { "psr-4": { @@ -32,7 +32,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/illuminate/filesystem/AwsS3V3Adapter.php b/vendor/illuminate/filesystem/AwsS3V3Adapter.php new file mode 100644 index 0000000..45d4f54 --- /dev/null +++ b/vendor/illuminate/filesystem/AwsS3V3Adapter.php @@ -0,0 +1,94 @@ +client = $client; + } + + /** + * Get the URL for the file at the given path. + * + * @param string $path + * @return string + * + * @throws \RuntimeException + */ + public function url($path) + { + // If an explicit base URL has been set on the disk configuration then we will use + // it as the base URL instead of the default path. This allows the developer to + // have full control over the base path for this filesystem's generated URLs. + if (isset($this->config['url'])) { + return $this->concatPathToUrl($this->config['url'], $this->prefixer->prefixPath($path)); + } + + return $this->client->getObjectUrl( + $this->config['bucket'], $this->prefixer->prefixPath($path) + ); + } + + /** + * Get a temporary URL for the file at the given path. + * + * @param string $path + * @param \DateTimeInterface $expiration + * @param array $options + * @return string + */ + public function temporaryUrl($path, $expiration, array $options = []) + { + $command = $this->client->getCommand('GetObject', array_merge([ + 'Bucket' => $this->config['bucket'], + 'Key' => $this->prefixer->prefixPath($path), + ], $options)); + + $uri = $this->client->createPresignedRequest( + $command, $expiration, $options + )->getUri(); + + // If an explicit base URL has been set on the disk configuration then we will use + // it as the base URL instead of the default path. This allows the developer to + // have full control over the base path for this filesystem's generated URLs. + if (isset($this->config['temporary_url'])) { + $uri = $this->replaceBaseUrl($uri, $this->config['temporary_url']); + } + + return (string) $uri; + } + + /** + * Get the underlying S3 client. + * + * @return \Aws\S3\S3Client + */ + public function getClient() + { + return $this->client; + } +} diff --git a/vendor/illuminate/filesystem/Cache.php b/vendor/illuminate/filesystem/Cache.php deleted file mode 100644 index 8ae2486..0000000 --- a/vendor/illuminate/filesystem/Cache.php +++ /dev/null @@ -1,71 +0,0 @@ -key = $key; - $this->expire = $expire; - $this->repository = $repository; - } - - /** - * Load the cache. - * - * @return void - */ - public function load() - { - $contents = $this->repository->get($this->key); - - if (! is_null($contents)) { - $this->setFromStorage($contents); - } - } - - /** - * Persist the cache. - * - * @return void - */ - public function save() - { - $contents = $this->getForStorage(); - - $this->repository->put($this->key, $contents, $this->expire); - } -} diff --git a/vendor/illuminate/filesystem/Filesystem.php b/vendor/illuminate/filesystem/Filesystem.php index 81282b0..e68bbf7 100644 --- a/vendor/illuminate/filesystem/Filesystem.php +++ b/vendor/illuminate/filesystem/Filesystem.php @@ -282,7 +282,9 @@ public function delete($paths) foreach ($paths as $path) { try { - if (! @unlink($path)) { + if (@unlink($path)) { + clearstatcache(false, $path); + } else { $success = false; } } catch (ErrorException $e) { @@ -475,6 +477,18 @@ public function isDirectory($directory) return is_dir($directory); } + /** + * Determine if the given path is a directory that does not contain any other files or directories. + * + * @param string $directory + * @param bool $ignoreDotFiles + * @return bool + */ + public function isEmptyDirectory($directory, $ignoreDotFiles = false) + { + return ! Finder::create()->ignoreDotFiles($ignoreDotFiles)->in($directory)->depth(0)->hasResults(); + } + /** * Determine if the given path is readable. * @@ -497,6 +511,20 @@ public function isWritable($path) return is_writable($path); } + /** + * Determine if two files are the same by comparing their hashes. + * + * @param string $firstFile + * @param string $secondFile + * @return bool + */ + public function hasSameHash($firstFile, $secondFile) + { + $hash = @md5_file($firstFile); + + return $hash && $hash === @md5_file($secondFile); + } + /** * Determine if the given path is a file. * @@ -657,10 +685,8 @@ public function copyDirectory($directory, $destination, $options = null) // If the current items is just a regular file, we will just copy this to the new // location and keep looping. If for some reason the copy fails we'll bail out // and return false, so the developer is aware that the copy process failed. - else { - if (! $this->copy($item->getPathname(), $target)) { - return false; - } + elseif (! $this->copy($item->getPathname(), $target)) { + return false; } } diff --git a/vendor/illuminate/filesystem/FilesystemAdapter.php b/vendor/illuminate/filesystem/FilesystemAdapter.php index 566528c..a162488 100644 --- a/vendor/illuminate/filesystem/FilesystemAdapter.php +++ b/vendor/illuminate/filesystem/FilesystemAdapter.php @@ -2,34 +2,39 @@ namespace Illuminate\Filesystem; +use Closure; use Illuminate\Contracts\Filesystem\Cloud as CloudFilesystemContract; -use Illuminate\Contracts\Filesystem\FileExistsException as ContractFileExistsException; -use Illuminate\Contracts\Filesystem\FileNotFoundException as ContractFileNotFoundException; use Illuminate\Contracts\Filesystem\Filesystem as FilesystemContract; use Illuminate\Http\File; use Illuminate\Http\UploadedFile; use Illuminate\Support\Arr; -use Illuminate\Support\Collection; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use InvalidArgumentException; -use League\Flysystem\Adapter\Ftp; -use League\Flysystem\Adapter\Local as LocalAdapter; -use League\Flysystem\AdapterInterface; -use League\Flysystem\AwsS3v3\AwsS3Adapter; -use League\Flysystem\Cached\CachedAdapter; -use League\Flysystem\FileExistsException; -use League\Flysystem\FileNotFoundException; -use League\Flysystem\FilesystemInterface; -use League\Flysystem\Sftp\SftpAdapter as Sftp; +use League\Flysystem\FilesystemAdapter as FlysystemAdapter; +use League\Flysystem\FilesystemOperator; +use League\Flysystem\Ftp\FtpAdapter; +use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter; +use League\Flysystem\PathPrefixer; +use League\Flysystem\PhpseclibV3\SftpAdapter; +use League\Flysystem\StorageAttributes; +use League\Flysystem\UnableToCopyFile; +use League\Flysystem\UnableToCreateDirectory; +use League\Flysystem\UnableToDeleteDirectory; +use League\Flysystem\UnableToDeleteFile; +use League\Flysystem\UnableToMoveFile; +use League\Flysystem\UnableToReadFile; +use League\Flysystem\UnableToRetrieveMetadata; +use League\Flysystem\UnableToSetVisibility; +use League\Flysystem\UnableToWriteFile; +use League\Flysystem\Visibility; use PHPUnit\Framework\Assert as PHPUnit; use Psr\Http\Message\StreamInterface; -use Psr\Http\Message\UriInterface; use RuntimeException; use Symfony\Component\HttpFoundation\StreamedResponse; /** - * @mixin \League\Flysystem\FilesystemInterface + * @mixin \League\Flysystem\FilesystemOperator */ class FilesystemAdapter implements CloudFilesystemContract { @@ -40,23 +45,59 @@ class FilesystemAdapter implements CloudFilesystemContract /** * The Flysystem filesystem implementation. * - * @var \League\Flysystem\FilesystemInterface + * @var \League\Flysystem\FilesystemOperator */ protected $driver; + /** + * The Flysystem adapter implementation. + * + * @var \League\Flysystem\FilesystemAdapter + */ + protected $adapter; + + /** + * The filesystem configuration. + * + * @var array + */ + protected $config; + + /** + * The Flysystem PathPrefixer instance. + * + * @var \League\Flysystem\PathPrefixer + */ + protected $prefixer; + + /** + * The temporary URL builder callback. + * + * @var \Closure|null + */ + protected $temporaryUrlCallback; + /** * Create a new filesystem adapter instance. * - * @param \League\Flysystem\FilesystemInterface $driver + * @param \League\Flysystem\FilesystemOperator $driver + * @param \League\Flysystem\FilesystemAdapter $adapter + * @param array $config * @return void */ - public function __construct(FilesystemInterface $driver) + public function __construct(FilesystemOperator $driver, FlysystemAdapter $adapter, array $config = []) { $this->driver = $driver; + $this->adapter = $adapter; + $this->config = $config; + + $this->prefixer = new PathPrefixer( + $config['root'] ?? '', $config['directory_separator'] ?? DIRECTORY_SEPARATOR + ); } /** - * Assert that the given file exists. + * Assert that the given file or directory exists. * * @param string|array $path * @param string|null $content @@ -64,11 +105,13 @@ public function __construct(FilesystemInterface $driver) */ public function assertExists($path, $content = null) { + clearstatcache(); + $paths = Arr::wrap($path); foreach ($paths as $path) { PHPUnit::assertTrue( - $this->exists($path), "Unable to find a file at path [{$path}]." + $this->exists($path), "Unable to find a file or directory at path [{$path}]." ); if (! is_null($content)) { @@ -77,7 +120,7 @@ public function assertExists($path, $content = null) PHPUnit::assertSame( $content, $actual, - "File [{$path}] was found, but content [{$actual}] does not match [{$content}]." + "File or directory [{$path}] was found, but content [{$actual}] does not match [{$content}]." ); } } @@ -86,18 +129,20 @@ public function assertExists($path, $content = null) } /** - * Assert that the given file does not exist. + * Assert that the given file or directory does not exist. * * @param string|array $path * @return $this */ public function assertMissing($path) { + clearstatcache(); + $paths = Arr::wrap($path); foreach ($paths as $path) { PHPUnit::assertFalse( - $this->exists($path), "Found unexpected file at path [{$path}]." + $this->exists($path), "Found unexpected file or directory at path [{$path}]." ); } @@ -105,7 +150,22 @@ public function assertMissing($path) } /** - * Determine if a file exists. + * Assert that the given directory is empty. + * + * @param string $path + * @return $this + */ + public function assertDirectoryEmpty($path) + { + PHPUnit::assertEmpty( + $this->allFiles($path), "Directory [{$path}] is not empty." + ); + + return $this; + } + + /** + * Determine if a file or directory exists. * * @param string $path * @return bool @@ -127,36 +187,72 @@ public function missing($path) } /** - * Get the full path for the file at the given "short" path. + * Determine if a file exists. * * @param string $path - * @return string + * @return bool */ - public function path($path) + public function fileExists($path) { - $adapter = $this->driver->getAdapter(); + return $this->driver->fileExists($path); + } - if ($adapter instanceof CachedAdapter) { - $adapter = $adapter->getAdapter(); - } + /** + * Determine if a file is missing. + * + * @param string $path + * @return bool + */ + public function fileMissing($path) + { + return ! $this->fileExists($path); + } - return $adapter->getPathPrefix().$path; + /** + * Determine if a directory exists. + * + * @param string $path + * @return bool + */ + public function directoryExists($path) + { + return $this->driver->directoryExists($path); } /** - * Get the contents of a file. + * Determine if a directory is missing. + * + * @param string $path + * @return bool + */ + public function directoryMissing($path) + { + return ! $this->directoryExists($path); + } + + /** + * Get the full path for the file at the given "short" path. * * @param string $path * @return string + */ + public function path($path) + { + return $this->prefixer->prefixPath($path); + } + + /** + * Get the contents of a file. * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException + * @param string $path + * @return string|null */ public function get($path) { try { return $this->driver->read($path); - } catch (FileNotFoundException $e) { - throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e); + } catch (UnableToReadFile $e) { + throw_if($this->throwsExceptions(), $e); } } @@ -165,7 +261,7 @@ public function get($path) * * @param string $path * @param string|null $name - * @param array|null $headers + * @param array $headers * @param string|null $disposition * @return \Symfony\Component\HttpFoundation\StreamedResponse */ @@ -173,17 +269,25 @@ public function response($path, $name = null, array $headers = [], $disposition { $response = new StreamedResponse; - $filename = $name ?? basename($path); + if (! array_key_exists('Content-Type', $headers)) { + $headers['Content-Type'] = $this->mimeType($path); + } - $disposition = $response->headers->makeDisposition( - $disposition, $filename, $this->fallbackName($filename) - ); + if (! array_key_exists('Content-Length', $headers)) { + $headers['Content-Length'] = $this->size($path); + } + + if (! array_key_exists('Content-Disposition', $headers)) { + $filename = $name ?? basename($path); + + $disposition = $response->headers->makeDisposition( + $disposition, $filename, $this->fallbackName($filename) + ); + + $headers['Content-Disposition'] = $disposition; + } - $response->headers->replace($headers + [ - 'Content-Type' => $this->mimeType($path), - 'Content-Length' => $this->size($path), - 'Content-Disposition' => $disposition, - ]); + $response->headers->replace($headers); $response->setCallback(function () use ($path) { $stream = $this->readStream($path); @@ -199,7 +303,6 @@ public function response($path, $name = null, array $headers = [], $disposition * * @param string $path * @param string|null $name - * @param array|null $headers * @return \Symfony\Component\HttpFoundation\StreamedResponse */ public function download($path, $name = null, array $headers = []) @@ -224,7 +327,7 @@ protected function fallbackName($name) * @param string $path * @param \Psr\Http\Message\StreamInterface|\Illuminate\Http\File|\Illuminate\Http\UploadedFile|string|resource $contents * @param mixed $options - * @return bool + * @return string|bool */ public function put($path, $contents, $options = []) { @@ -240,13 +343,23 @@ public function put($path, $contents, $options = []) return $this->putFile($path, $contents, $options); } - if ($contents instanceof StreamInterface) { - return $this->driver->putStream($path, $contents->detach(), $options); + try { + if ($contents instanceof StreamInterface) { + $this->driver->writeStream($path, $contents->detach(), $options); + + return true; + } + + is_resource($contents) + ? $this->driver->writeStream($path, $contents, $options) + : $this->driver->write($path, $contents, $options); + } catch (UnableToWriteFile|UnableToSetVisibility $e) { + throw_if($this->throwsExceptions(), $e); + + return false; } - return is_resource($contents) - ? $this->driver->putStream($path, $contents, $options) - : $this->driver->put($path, $contents, $options); + return true; } /** @@ -299,7 +412,7 @@ public function putFileAs($path, $file, $name, $options = []) */ public function getVisibility($path) { - if ($this->driver->getVisibility($path) == AdapterInterface::VISIBILITY_PUBLIC) { + if ($this->driver->visibility($path) == Visibility::PUBLIC) { return FilesystemContract::VISIBILITY_PUBLIC; } @@ -315,7 +428,15 @@ public function getVisibility($path) */ public function setVisibility($path, $visibility) { - return $this->driver->setVisibility($path, $this->parseVisibility($visibility)); + try { + $this->driver->setVisibility($path, $this->parseVisibility($visibility)); + } catch (UnableToSetVisibility $e) { + throw_if($this->throwsExceptions(), $e); + + return false; + } + + return true; } /** @@ -328,7 +449,7 @@ public function setVisibility($path, $visibility) */ public function prepend($path, $data, $separator = PHP_EOL) { - if ($this->exists($path)) { + if ($this->fileExists($path)) { return $this->put($path, $data.$separator.$this->get($path)); } @@ -345,7 +466,7 @@ public function prepend($path, $data, $separator = PHP_EOL) */ public function append($path, $data, $separator = PHP_EOL) { - if ($this->exists($path)) { + if ($this->fileExists($path)) { return $this->put($path, $this->get($path).$separator.$data); } @@ -366,10 +487,10 @@ public function delete($paths) foreach ($paths as $path) { try { - if (! $this->driver->delete($path)) { - $success = false; - } - } catch (FileNotFoundException $e) { + $this->driver->delete($path); + } catch (UnableToDeleteFile $e) { + throw_if($this->throwsExceptions(), $e); + $success = false; } } @@ -386,7 +507,15 @@ public function delete($paths) */ public function copy($from, $to) { - return $this->driver->copy($from, $to); + try { + $this->driver->copy($from, $to); + } catch (UnableToCopyFile $e) { + throw_if($this->throwsExceptions(), $e); + + return false; + } + + return true; } /** @@ -398,7 +527,15 @@ public function copy($from, $to) */ public function move($from, $to) { - return $this->driver->rename($from, $to); + try { + $this->driver->move($from, $to); + } catch (UnableToMoveFile $e) { + throw_if($this->throwsExceptions(), $e); + + return false; + } + + return true; } /** @@ -409,7 +546,7 @@ public function move($from, $to) */ public function size($path) { - return $this->driver->getSize($path); + return $this->driver->fileSize($path); } /** @@ -420,7 +557,13 @@ public function size($path) */ public function mimeType($path) { - return $this->driver->getMimetype($path); + try { + return $this->driver->mimeType($path); + } catch (UnableToRetrieveMetadata $e) { + throw_if($this->throwsExceptions(), $e); + } + + return false; } /** @@ -431,38 +574,7 @@ public function mimeType($path) */ public function lastModified($path) { - return $this->driver->getTimestamp($path); - } - - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - * - * @throws \RuntimeException - */ - public function url($path) - { - $adapter = $this->driver->getAdapter(); - - if ($adapter instanceof CachedAdapter) { - $adapter = $adapter->getAdapter(); - } - - if (method_exists($adapter, 'getUrl')) { - return $adapter->getUrl($path); - } elseif (method_exists($this->driver, 'getUrl')) { - return $this->driver->getUrl($path); - } elseif ($adapter instanceof AwsS3Adapter) { - return $this->getAwsUrl($adapter, $path); - } elseif ($adapter instanceof Ftp || $adapter instanceof Sftp) { - return $this->getFtpUrl($path); - } elseif ($adapter instanceof LocalAdapter) { - return $this->getLocalUrl($path); - } else { - throw new RuntimeException('This driver does not support retrieving URLs.'); - } + return $this->driver->lastModified($path); } /** @@ -471,9 +583,9 @@ public function url($path) public function readStream($path) { try { - return $this->driver->readStream($path) ?: null; - } catch (FileNotFoundException $e) { - throw new ContractFileNotFoundException($e->getMessage(), $e->getCode(), $e); + return $this->driver->readStream($path); + } catch (UnableToReadFile $e) { + throw_if($this->throwsExceptions(), $e); } } @@ -483,31 +595,39 @@ public function readStream($path) public function writeStream($path, $resource, array $options = []) { try { - return $this->driver->writeStream($path, $resource, $options); - } catch (FileExistsException $e) { - throw new ContractFileExistsException($e->getMessage(), $e->getCode(), $e); + $this->driver->writeStream($path, $resource, $options); + } catch (UnableToWriteFile|UnableToSetVisibility $e) { + throw_if($this->throwsExceptions(), $e); + + return false; } + + return true; } /** * Get the URL for the file at the given path. * - * @param \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter * @param string $path * @return string + * + * @throws \RuntimeException */ - protected function getAwsUrl($adapter, $path) + public function url($path) { - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (! is_null($url = $this->driver->getConfig()->get('url'))) { - return $this->concatPathToUrl($url, $adapter->getPathPrefix().$path); - } + $adapter = $this->adapter; - return $adapter->getClient()->getObjectUrl( - $adapter->getBucket(), $adapter->getPathPrefix().$path - ); + if (method_exists($adapter, 'getUrl')) { + return $adapter->getUrl($path); + } elseif (method_exists($this->driver, 'getUrl')) { + return $this->driver->getUrl($path); + } elseif ($adapter instanceof FtpAdapter || $adapter instanceof SftpAdapter) { + return $this->getFtpUrl($path); + } elseif ($adapter instanceof LocalAdapter) { + return $this->getLocalUrl($path); + } else { + throw new RuntimeException('This driver does not support retrieving URLs.'); + } } /** @@ -518,10 +638,8 @@ protected function getAwsUrl($adapter, $path) */ protected function getFtpUrl($path) { - $config = $this->driver->getConfig(); - - return $config->has('url') - ? $this->concatPathToUrl($config->get('url'), $path) + return isset($this->config['url']) + ? $this->concatPathToUrl($this->config['url'], $path) : $path; } @@ -533,13 +651,11 @@ protected function getFtpUrl($path) */ protected function getLocalUrl($path) { - $config = $this->driver->getConfig(); - // If an explicit base URL has been set on the disk configuration then we will use // it as the base URL instead of the default path. This allows the developer to // have full control over the base path for this filesystem's generated URLs. - if ($config->has('url')) { - return $this->concatPathToUrl($config->get('url'), $path); + if (isset($this->config['url'])) { + return $this->concatPathToUrl($this->config['url'], $path); } $path = '/storage/'.$path; @@ -547,7 +663,7 @@ protected function getLocalUrl($path) // If the path contains "storage/public", it probably means the developer is using // the default disk to generate the path instead of the "public" disk like they // are really supposed to use. We will remove the public from this path here. - if (Str::contains($path, '/storage/public/')) { + if (str_contains($path, '/storage/public/')) { return Str::replaceFirst('/public/', '/', $path); } @@ -566,51 +682,17 @@ protected function getLocalUrl($path) */ public function temporaryUrl($path, $expiration, array $options = []) { - $adapter = $this->driver->getAdapter(); - - if ($adapter instanceof CachedAdapter) { - $adapter = $adapter->getAdapter(); + if (method_exists($this->adapter, 'getTemporaryUrl')) { + return $this->adapter->getTemporaryUrl($path, $expiration, $options); } - if (method_exists($adapter, 'getTemporaryUrl')) { - return $adapter->getTemporaryUrl($path, $expiration, $options); - } elseif ($adapter instanceof AwsS3Adapter) { - return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options); - } else { - throw new RuntimeException('This driver does not support creating temporary URLs.'); - } - } - - /** - * Get a temporary URL for the file at the given path. - * - * @param \League\Flysystem\AwsS3v3\AwsS3Adapter $adapter - * @param string $path - * @param \DateTimeInterface $expiration - * @param array $options - * @return string - */ - public function getAwsTemporaryUrl($adapter, $path, $expiration, $options) - { - $client = $adapter->getClient(); - - $command = $client->getCommand('GetObject', array_merge([ - 'Bucket' => $adapter->getBucket(), - 'Key' => $adapter->getPathPrefix().$path, - ], $options)); - - $uri = $client->createPresignedRequest( - $command, $expiration - )->getUri(); - - // If an explicit base URL has been set on the disk configuration then we will use - // it as the base URL instead of the default path. This allows the developer to - // have full control over the base path for this filesystem's generated URLs. - if (! is_null($url = $this->driver->getConfig()->get('temporary_url'))) { - $uri = $this->replaceBaseUrl($uri, $url); + if ($this->temporaryUrlCallback) { + return $this->temporaryUrlCallback->bindTo($this, static::class)( + $path, $expiration, $options + ); } - return (string) $uri; + throw new RuntimeException('This driver does not support creating temporary URLs.'); } /** @@ -651,9 +733,15 @@ protected function replaceBaseUrl($uri, $url) */ public function files($directory = null, $recursive = false) { - $contents = $this->driver->listContents($directory ?? '', $recursive); - - return $this->filterContentsByType($contents, 'file'); + return $this->driver->listContents($directory ?? '', $recursive) + ->filter(function (StorageAttributes $attributes) { + return $attributes->isFile(); + }) + ->sortByPath() + ->map(function (StorageAttributes $attributes) { + return $attributes->path(); + }) + ->toArray(); } /** @@ -676,13 +764,18 @@ public function allFiles($directory = null) */ public function directories($directory = null, $recursive = false) { - $contents = $this->driver->listContents($directory ?? '', $recursive); - - return $this->filterContentsByType($contents, 'dir'); + return $this->driver->listContents($directory ?? '', $recursive) + ->filter(function (StorageAttributes $attributes) { + return $attributes->isDir(); + }) + ->map(function (StorageAttributes $attributes) { + return $attributes->path(); + }) + ->toArray(); } /** - * Get all (recursive) of the directories within a given directory. + * Get all the directories within a given directory (recursive). * * @param string|null $directory * @return array @@ -700,7 +793,15 @@ public function allDirectories($directory = null) */ public function makeDirectory($path) { - return $this->driver->createDir($path); + try { + $this->driver->createDirectory($path); + } catch (UnableToCreateDirectory|UnableToSetVisibility $e) { + throw_if($this->throwsExceptions(), $e); + + return false; + } + + return true; } /** @@ -711,47 +812,45 @@ public function makeDirectory($path) */ public function deleteDirectory($directory) { - return $this->driver->deleteDir($directory); + try { + $this->driver->deleteDirectory($directory); + } catch (UnableToDeleteDirectory $e) { + throw_if($this->throwsExceptions(), $e); + + return false; + } + + return true; } /** - * Flush the Flysystem cache. + * Get the Flysystem driver. * - * @return void + * @return \League\Flysystem\FilesystemOperator */ - public function flushCache() + public function getDriver() { - $adapter = $this->driver->getAdapter(); - - if ($adapter instanceof CachedAdapter) { - $adapter->getCache()->flush(); - } + return $this->driver; } /** - * Get the Flysystem driver. + * Get the Flysystem adapter. * - * @return \League\Flysystem\FilesystemInterface + * @return \League\Flysystem\FilesystemAdapter */ - public function getDriver() + public function getAdapter() { - return $this->driver; + return $this->adapter; } /** - * Filter directory contents by type. + * Get the configuration values. * - * @param array $contents - * @param string $type * @return array */ - protected function filterContentsByType($contents, $type) + public function getConfig() { - return Collection::make($contents) - ->where('type', $type) - ->pluck('path') - ->values() - ->all(); + return $this->config; } /** @@ -768,14 +867,32 @@ protected function parseVisibility($visibility) return; } - switch ($visibility) { - case FilesystemContract::VISIBILITY_PUBLIC: - return AdapterInterface::VISIBILITY_PUBLIC; - case FilesystemContract::VISIBILITY_PRIVATE: - return AdapterInterface::VISIBILITY_PRIVATE; - } + return match ($visibility) { + FilesystemContract::VISIBILITY_PUBLIC => Visibility::PUBLIC, + FilesystemContract::VISIBILITY_PRIVATE => Visibility::PRIVATE, + default => throw new InvalidArgumentException("Unknown visibility: {$visibility}."), + }; + } - throw new InvalidArgumentException("Unknown visibility: {$visibility}."); + /** + * Define a custom temporary URL builder callback. + * + * @param \Closure $callback + * @return void + */ + public function buildTemporaryUrlsUsing(Closure $callback) + { + $this->temporaryUrlCallback = $callback; + } + + /** + * Determine if Flysystem exceptions should be thrown. + * + * @return bool + */ + protected function throwsExceptions(): bool + { + return (bool) ($this->config['throw'] ?? false); } /** @@ -793,6 +910,6 @@ public function __call($method, array $parameters) return $this->macroCall($method, $parameters); } - return $this->driver->{$method}(...array_values($parameters)); + return $this->driver->{$method}(...$parameters); } } diff --git a/vendor/illuminate/filesystem/FilesystemManager.php b/vendor/illuminate/filesystem/FilesystemManager.php index d89b1df..cd2e1dd 100644 --- a/vendor/illuminate/filesystem/FilesystemManager.php +++ b/vendor/illuminate/filesystem/FilesystemManager.php @@ -7,15 +7,17 @@ use Illuminate\Contracts\Filesystem\Factory as FactoryContract; use Illuminate\Support\Arr; use InvalidArgumentException; -use League\Flysystem\Adapter\Ftp as FtpAdapter; -use League\Flysystem\Adapter\Local as LocalAdapter; -use League\Flysystem\AdapterInterface; -use League\Flysystem\AwsS3v3\AwsS3Adapter as S3Adapter; -use League\Flysystem\Cached\CachedAdapter; -use League\Flysystem\Cached\Storage\Memory as MemoryStore; +use League\Flysystem\AwsS3V3\AwsS3V3Adapter as S3Adapter; +use League\Flysystem\AwsS3V3\PortableVisibilityConverter as AwsS3PortableVisibilityConverter; use League\Flysystem\Filesystem as Flysystem; -use League\Flysystem\FilesystemInterface; -use League\Flysystem\Sftp\SftpAdapter; +use League\Flysystem\FilesystemAdapter as FlysystemAdapter; +use League\Flysystem\Ftp\FtpAdapter; +use League\Flysystem\Ftp\FtpConnectionOptions; +use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter; +use League\Flysystem\PhpseclibV3\SftpAdapter; +use League\Flysystem\PhpseclibV3\SftpConnectionProvider; +use League\Flysystem\UnixVisibility\PortableVisibilityConverter; +use League\Flysystem\Visibility; /** * @mixin \Illuminate\Contracts\Filesystem\Filesystem @@ -126,7 +128,7 @@ protected function get($name) */ protected function resolve($name, $config = null) { - $config = $config ?? $this->getConfig($name); + $config ??= $this->getConfig($name); if (empty($config['driver'])) { throw new InvalidArgumentException("Disk [{$name}] does not have a configured driver."); @@ -155,13 +157,7 @@ protected function resolve($name, $config = null) */ protected function callCustomCreator(array $config) { - $driver = $this->customCreators[$config['driver']]($this->app, $config); - - if ($driver instanceof FilesystemInterface) { - return $this->adapt($driver); - } - - return $driver; + return $this->customCreators[$config['driver']]($this->app, $config); } /** @@ -172,15 +168,20 @@ protected function callCustomCreator(array $config) */ public function createLocalDriver(array $config) { - $permissions = $config['permissions'] ?? []; + $visibility = PortableVisibilityConverter::fromArray( + $config['permissions'] ?? [], + $config['directory_visibility'] ?? $config['visibility'] ?? Visibility::PRIVATE + ); $links = ($config['links'] ?? null) === 'skip' ? LocalAdapter::SKIP_LINKS : LocalAdapter::DISALLOW_LINKS; - return $this->adapt($this->createFlysystem(new LocalAdapter( - $config['root'], $config['lock'] ?? LOCK_EX, $links, $permissions - ), $config)); + $adapter = new LocalAdapter( + $config['root'], $visibility, $config['lock'] ?? LOCK_EX, $links + ); + + return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); } /** @@ -191,9 +192,13 @@ public function createLocalDriver(array $config) */ public function createFtpDriver(array $config) { - return $this->adapt($this->createFlysystem( - new FtpAdapter($config), $config - )); + if (! isset($config['root'])) { + $config['root'] = ''; + } + + $adapter = new FtpAdapter(FtpConnectionOptions::fromArray($config)); + + return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); } /** @@ -204,9 +209,17 @@ public function createFtpDriver(array $config) */ public function createSftpDriver(array $config) { - return $this->adapt($this->createFlysystem( - new SftpAdapter($config), $config - )); + $provider = SftpConnectionProvider::fromArray($config); + + $root = $config['root'] ?? '/'; + + $visibility = PortableVisibilityConverter::fromArray( + $config['permissions'] ?? [] + ); + + $adapter = new SftpAdapter($provider, $root, $visibility); + + return new FilesystemAdapter($this->createFlysystem($adapter, $config), $adapter, $config); } /** @@ -219,15 +232,21 @@ public function createS3Driver(array $config) { $s3Config = $this->formatS3Config($config); - $root = $s3Config['root'] ?? null; + $root = (string) ($s3Config['root'] ?? ''); + + $visibility = new AwsS3PortableVisibilityConverter( + $config['visibility'] ?? Visibility::PUBLIC + ); + + $streamReads = $s3Config['stream_reads'] ?? false; - $options = $config['options'] ?? []; + $client = new S3Client($s3Config); - $streamReads = $config['stream_reads'] ?? false; + $adapter = new S3Adapter($client, $s3Config['bucket'], $root, $visibility, null, $config['options'] ?? [], $streamReads); - return $this->adapt($this->createFlysystem( - new S3Adapter(new S3Client($s3Config), $s3Config['bucket'], $root, $options, $streamReads), $config - )); + return new AwsS3V3Adapter( + $this->createFlysystem($adapter, $config), $adapter, $s3Config, $client + ); } /** @@ -250,53 +269,19 @@ protected function formatS3Config(array $config) /** * Create a Flysystem instance with the given adapter. * - * @param \League\Flysystem\AdapterInterface $adapter + * @param \League\Flysystem\FilesystemAdapter $adapter * @param array $config - * @return \League\Flysystem\FilesystemInterface + * @return \League\Flysystem\FilesystemOperator */ - protected function createFlysystem(AdapterInterface $adapter, array $config) + protected function createFlysystem(FlysystemAdapter $adapter, array $config) { - $cache = Arr::pull($config, 'cache'); - - $config = Arr::only($config, ['visibility', 'disable_asserts', 'url', 'temporary_url']); - - if ($cache) { - $adapter = new CachedAdapter($adapter, $this->createCacheStore($cache)); - } - - return new Flysystem($adapter, count($config) > 0 ? $config : null); - } - - /** - * Create a cache store instance. - * - * @param mixed $config - * @return \League\Flysystem\Cached\CacheInterface - * - * @throws \InvalidArgumentException - */ - protected function createCacheStore($config) - { - if ($config === true) { - return new MemoryStore; - } - - return new Cache( - $this->app['cache']->store($config['store']), - $config['prefix'] ?? 'flysystem', - $config['expire'] ?? null - ); - } - - /** - * Adapt the filesystem implementation. - * - * @param \League\Flysystem\FilesystemInterface $filesystem - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - protected function adapt(FilesystemInterface $filesystem) - { - return new FilesystemAdapter($filesystem); + return new Flysystem($adapter, Arr::only($config, [ + 'directory_visibility', + 'disable_asserts', + 'temporary_url', + 'url', + 'visibility', + ])); } /** @@ -367,7 +352,7 @@ public function forgetDisk($disk) */ public function purge($name = null) { - $name = $name ?? $this->getDefaultDriver(); + $name ??= $this->getDefaultDriver(); unset($this->disks[$name]); } @@ -386,6 +371,19 @@ public function extend($driver, Closure $callback) return $this; } + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return $this + */ + public function setApplication($app) + { + $this->app = $app; + + return $this; + } + /** * Dynamically call the default driver instance. * diff --git a/vendor/illuminate/filesystem/composer.json b/vendor/illuminate/filesystem/composer.json index ca82b7a..13d52d8 100644 --- a/vendor/illuminate/filesystem/composer.json +++ b/vendor/illuminate/filesystem/composer.json @@ -14,12 +14,12 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0", - "symfony/finder": "^5.4" + "php": "^8.0.2", + "illuminate/collections": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0", + "symfony/finder": "^6.0" }, "autoload": { "psr-4": { @@ -28,19 +28,19 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { "ext-ftp": "Required to use the Flysystem FTP driver.", "illuminate/http": "Required for handling uploaded files (^7.0).", - "league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.1).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", + "league/flysystem": "Required to use the Flysystem local driver (^3.0.16).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.0).", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.0).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "symfony/filesystem": "Required to enable support for relative symbolic links (^5.4).", - "symfony/mime": "Required to enable support for guessing extensions (^5.4)." + "symfony/filesystem": "Required to enable support for relative symbolic links (^6.0).", + "symfony/mime": "Required to enable support for guessing extensions (^6.0)." }, "config": { "sort-packages": true diff --git a/vendor/illuminate/macroable/composer.json b/vendor/illuminate/macroable/composer.json index dfa5c62..0417dbe 100644 --- a/vendor/illuminate/macroable/composer.json +++ b/vendor/illuminate/macroable/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.3|^8.0" + "php": "^8.0.2" }, "autoload": { "psr-4": { @@ -23,7 +23,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/illuminate/pipeline/Pipeline.php b/vendor/illuminate/pipeline/Pipeline.php index d2924e5..53b9fef 100644 --- a/vendor/illuminate/pipeline/Pipeline.php +++ b/vendor/illuminate/pipeline/Pipeline.php @@ -13,7 +13,7 @@ class Pipeline implements PipelineContract /** * The container implementation. * - * @var \Illuminate\Contracts\Container\Container + * @var \Illuminate\Contracts\Container\Container|null */ protected $container; @@ -75,6 +75,19 @@ public function through($pipes) return $this; } + /** + * Push additional pipes onto the pipeline. + * + * @param array|mixed $pipes + * @return $this + */ + public function pipe($pipes) + { + array_push($this->pipes, ...(is_array($pipes) ? $pipes : func_get_args())); + + return $this; + } + /** * Set the method to call on the pipes. * diff --git a/vendor/illuminate/pipeline/composer.json b/vendor/illuminate/pipeline/composer.json index ef6805b..7e640af 100644 --- a/vendor/illuminate/pipeline/composer.json +++ b/vendor/illuminate/pipeline/composer.json @@ -14,9 +14,9 @@ } ], "require": { - "php": "^7.3|^8.0", - "illuminate/contracts": "^8.0", - "illuminate/support": "^8.0" + "php": "^8.0.2", + "illuminate/contracts": "^9.0", + "illuminate/support": "^9.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/illuminate/support/Carbon.php b/vendor/illuminate/support/Carbon.php index 004b27b..972d7eb 100644 --- a/vendor/illuminate/support/Carbon.php +++ b/vendor/illuminate/support/Carbon.php @@ -4,9 +4,12 @@ use Carbon\Carbon as BaseCarbon; use Carbon\CarbonImmutable as BaseCarbonImmutable; +use Illuminate\Support\Traits\Conditionable; class Carbon extends BaseCarbon { + use Conditionable; + /** * {@inheritdoc} */ diff --git a/vendor/illuminate/support/ConfigurationUrlParser.php b/vendor/illuminate/support/ConfigurationUrlParser.php index be54b9a..a1b9337 100644 --- a/vendor/illuminate/support/ConfigurationUrlParser.php +++ b/vendor/illuminate/support/ConfigurationUrlParser.php @@ -67,9 +67,7 @@ protected function getPrimaryOptions($url) 'port' => $url['port'] ?? null, 'username' => $url['user'] ?? null, 'password' => $url['pass'] ?? null, - ], function ($value) { - return ! is_null($value); - }); + ], fn ($value) => ! is_null($value)); } /** diff --git a/vendor/illuminate/support/DateFactory.php b/vendor/illuminate/support/DateFactory.php index e1d0ca1..43aa054 100644 --- a/vendor/illuminate/support/DateFactory.php +++ b/vendor/illuminate/support/DateFactory.php @@ -64,7 +64,7 @@ * @method static Carbon setHumanDiffOptions($humanDiffOptions) * @method static bool setLocale($locale) * @method static void setMidDayAt($hour) - * @method static Carbon setTestNow($testNow = null) + * @method static void setTestNow($testNow = null) * @method static void setToStringFormat($format) * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) * @method static Carbon setUtf8($utf8) @@ -211,7 +211,7 @@ public function __call($method, $parameters) $dateClass = static::$dateClass ?: $defaultClassName; - // Check if date can be created using public class method... + // Check if the date can be created using the public class method... if (method_exists($dateClass, $method) || method_exists($dateClass, 'hasMacro') && $dateClass::hasMacro($method)) { return $dateClass::$method(...$parameters); diff --git a/vendor/illuminate/support/Env.php b/vendor/illuminate/support/Env.php index b310073..4d5747a 100644 --- a/vendor/illuminate/support/Env.php +++ b/vendor/illuminate/support/Env.php @@ -96,8 +96,6 @@ public static function get($key, $default = null) return $value; }) - ->getOrCall(function () use ($default) { - return value($default); - }); + ->getOrCall(fn () => value($default)); } } diff --git a/vendor/illuminate/support/Facades/App.php b/vendor/illuminate/support/Facades/App.php index 0adb144..8fbec3d 100644 --- a/vendor/illuminate/support/Facades/App.php +++ b/vendor/illuminate/support/Facades/App.php @@ -8,6 +8,7 @@ * @method static \Illuminate\Support\ServiceProvider resolveProvider(string $provider) * @method static array getProviders(\Illuminate\Support\ServiceProvider|string $provider) * @method static mixed make($abstract, array $parameters = []) + * @method static mixed makeWith($abstract, array $parameters = []) * @method static bool configurationIsCached() * @method static bool hasBeenBootstrapped() * @method static bool isDownForMaintenance() diff --git a/vendor/illuminate/support/Facades/Blade.php b/vendor/illuminate/support/Facades/Blade.php index 8c7df0c..e4b804e 100644 --- a/vendor/illuminate/support/Facades/Blade.php +++ b/vendor/illuminate/support/Facades/Blade.php @@ -8,6 +8,8 @@ * @method static array getExtensions() * @method static bool check(string $name, array ...$parameters) * @method static string compileString(string $value) + * @method static string render(string $string, array $data = [], bool $deleteCachedView = false) + * @method static string renderComponent(\Illuminate\View\Component $component) * @method static string getPath() * @method static string stripParentheses(string $expression) * @method static void aliasComponent(string $path, string|null $alias = null) @@ -15,7 +17,8 @@ * @method static void compile(string|null $path = null) * @method static void component(string $class, string|null $alias = null, string $prefix = '') * @method static void components(array $components, string $prefix = '') - * @method static void componentNamespace(string $namespace, string $prefix) + * @method static void anonymousComponentNamespace(string $directory, string $prefix = null) + * @method static void componentNamespace(string $prefix, string $directory = null) * @method static void directive(string $name, callable $handler) * @method static void extend(callable $compiler) * @method static void if(string $name, callable $callback) diff --git a/vendor/illuminate/support/Facades/Broadcast.php b/vendor/illuminate/support/Facades/Broadcast.php index 5dd79ca..d3c2606 100644 --- a/vendor/illuminate/support/Facades/Broadcast.php +++ b/vendor/illuminate/support/Facades/Broadcast.php @@ -6,10 +6,11 @@ /** * @method static \Illuminate\Broadcasting\Broadcasters\Broadcaster channel(string $channel, callable|string $callback, array $options = []) - * @method static mixed auth(\Illuminate\Http\Request $request) + * @method static \Illuminate\Broadcasting\BroadcastManager socket($request = null) * @method static \Illuminate\Contracts\Broadcasting\Broadcaster connection($name = null); + * @method static mixed auth(\Illuminate\Http\Request $request) + * @method static void resolveAuthenticatedUserUsing(Closure $callback) * @method static void routes(array $attributes = null) - * @method static \Illuminate\Broadcasting\BroadcastManager socket($request = null) * * @see \Illuminate\Contracts\Broadcasting\Factory */ diff --git a/vendor/illuminate/support/Facades/Bus.php b/vendor/illuminate/support/Facades/Bus.php index 8000674..f0c22cb 100644 --- a/vendor/illuminate/support/Facades/Bus.php +++ b/vendor/illuminate/support/Facades/Bus.php @@ -24,7 +24,12 @@ * @method static void assertDispatchedAfterResponseTimes(string $command, int $times = 1) * @method static void assertNotDispatchedAfterResponse(string|\Closure $command, callable $callback = null) * @method static void assertBatched(callable $callback) + * @method static void assertBatchCount(int $count) * @method static void assertChained(array $expectedChain) + * @method static void assertDispatchedSync(string|\Closure $command, callable $callback = null) + * @method static void assertDispatchedSyncTimes(string $command, int $times = 1) + * @method static void assertNotDispatchedSync(string|\Closure $command, callable $callback = null) + * @method static void assertDispatchedWithoutChain(string|\Closure $command, callable $callback = null) * * @see \Illuminate\Contracts\Bus\Dispatcher */ diff --git a/vendor/illuminate/support/Facades/Cache.php b/vendor/illuminate/support/Facades/Cache.php index 70aa1dc..18fb9c4 100644 --- a/vendor/illuminate/support/Facades/Cache.php +++ b/vendor/illuminate/support/Facades/Cache.php @@ -14,10 +14,10 @@ * @method static bool forget(string $key) * @method static bool has(string $key) * @method static bool missing(string $key) - * @method static bool put(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) + * @method static bool put(array|string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) * @method static int|bool decrement(string $key, $value = 1) * @method static int|bool increment(string $key, $value = 1) - * @method static mixed get(string $key, mixed $default = null) + * @method static mixed get(array|string $key, mixed $default = null) * @method static mixed pull(string $key, mixed $default = null) * @method static mixed remember(string $key, \DateTimeInterface|\DateInterval|int $ttl, \Closure $callback) * @method static mixed rememberForever(string $key, \Closure $callback) diff --git a/vendor/illuminate/support/Facades/DB.php b/vendor/illuminate/support/Facades/DB.php index 554dd22..08ca4a9 100644 --- a/vendor/illuminate/support/Facades/DB.php +++ b/vendor/illuminate/support/Facades/DB.php @@ -28,6 +28,7 @@ * @method static void enableQueryLog() * @method static void disableQueryLog() * @method static void flushQueryLog() + * @method static void registerDoctrineType(string $class, string $name, string $type) * @method static \Illuminate\Database\Connection beforeExecuting(\Closure $callback) * @method static void listen(\Closure $callback) * @method static void rollBack(int $toLevel = null) diff --git a/vendor/illuminate/support/Facades/Date.php b/vendor/illuminate/support/Facades/Date.php index 68d99a4..2f2a39e 100644 --- a/vendor/illuminate/support/Facades/Date.php +++ b/vendor/illuminate/support/Facades/Date.php @@ -16,23 +16,23 @@ * @method static \Illuminate\Support\Carbon createFromTimestampMs($timestamp, $tz = null) * @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp) * @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) - * @method static \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption) - * @method static \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption) + * @method static void disableHumanDiffOption($humanDiffOption) + * @method static void enableHumanDiffOption($humanDiffOption) * @method static \Illuminate\Support\Carbon fromSerialized($value) - * @method static \Illuminate\Support\Carbon getLastErrors() - * @method static \Illuminate\Support\Carbon getTestNow() + * @method static array getLastErrors() + * @method static \Illuminate\Support\Carbon|null getTestNow() * @method static \Illuminate\Support\Carbon instance($date) - * @method static \Illuminate\Support\Carbon isMutable() + * @method static bool isMutable() * @method static \Illuminate\Support\Carbon maxValue() * @method static \Illuminate\Support\Carbon minValue() * @method static \Illuminate\Support\Carbon now($tz = null) * @method static \Illuminate\Support\Carbon parse($time = null, $tz = null) - * @method static \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions) - * @method static \Illuminate\Support\Carbon setTestNow($testNow = null) - * @method static \Illuminate\Support\Carbon setUtf8($utf8) + * @method static void setHumanDiffOptions($humanDiffOptions) + * @method static void setTestNow($testNow = null) + * @method static void setUtf8($utf8) * @method static \Illuminate\Support\Carbon today($tz = null) * @method static \Illuminate\Support\Carbon tomorrow($tz = null) - * @method static \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true) + * @method static void useStrictMode($strictModeEnabled = true) * @method static \Illuminate\Support\Carbon yesterday($tz = null) * @method static \Illuminate\Support\Carbon|false createFromFormat($format, $time, $tz = null) * @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) diff --git a/vendor/illuminate/support/Facades/Event.php b/vendor/illuminate/support/Facades/Event.php index 02f26f9..86fd00f 100644 --- a/vendor/illuminate/support/Facades/Event.php +++ b/vendor/illuminate/support/Facades/Event.php @@ -22,7 +22,7 @@ * @method static void forget(string $event) * @method static void forgetPushed() * @method static void listen(\Closure|string|array $events, \Closure|string|array $listener = null) - * @method static void push(string $event, array $payload = []) + * @method static void push(string $event, object|array $payload = []) * @method static void subscribe(object|string $subscriber) * * @see \Illuminate\Events\Dispatcher diff --git a/vendor/illuminate/support/Facades/Facade.php b/vendor/illuminate/support/Facades/Facade.php index befe902..d17e16c 100644 --- a/vendor/illuminate/support/Facades/Facade.php +++ b/vendor/illuminate/support/Facades/Facade.php @@ -3,6 +3,10 @@ namespace Illuminate\Support\Facades; use Closure; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Arr; +use Illuminate\Support\Js; +use Illuminate\Support\Str; use Mockery; use Mockery\LegacyMockInterface; use RuntimeException; @@ -23,6 +27,13 @@ abstract class Facade */ protected static $resolvedInstance; + /** + * Indicates if the resolved instance should be cached. + * + * @var bool + */ + protected static $cached = true; + /** * Run a Closure when the facade has been resolved. * @@ -84,12 +95,28 @@ public static function shouldReceive() $name = static::getFacadeAccessor(); $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); + ? static::$resolvedInstance[$name] + : static::createFreshMockInstance(); return $mock->shouldReceive(...func_get_args()); } + /** + * Initiate a mock expectation on the facade. + * + * @return \Mockery\Expectation + */ + public static function expects() + { + $name = static::getFacadeAccessor(); + + $mock = static::isMock() + ? static::$resolvedInstance[$name] + : static::createFreshMockInstance(); + + return $mock->expects(...func_get_args()); + } + /** * Create a fresh mock instance for the given class. * @@ -181,21 +208,21 @@ protected static function getFacadeAccessor() /** * Resolve the facade root instance from the container. * - * @param object|string $name + * @param string $name * @return mixed */ protected static function resolveFacadeInstance($name) { - if (is_object($name)) { - return $name; - } - if (isset(static::$resolvedInstance[$name])) { return static::$resolvedInstance[$name]; } if (static::$app) { - return static::$resolvedInstance[$name] = static::$app[$name]; + if (static::$cached) { + return static::$resolvedInstance[$name] = static::$app[$name]; + } + + return static::$app[$name]; } } @@ -220,6 +247,55 @@ public static function clearResolvedInstances() static::$resolvedInstance = []; } + /** + * Get the application default aliases. + * + * @return \Illuminate\Support\Collection + */ + public static function defaultAliases() + { + return collect([ + 'App' => App::class, + 'Arr' => Arr::class, + 'Artisan' => Artisan::class, + 'Auth' => Auth::class, + 'Blade' => Blade::class, + 'Broadcast' => Broadcast::class, + 'Bus' => Bus::class, + 'Cache' => Cache::class, + 'Config' => Config::class, + 'Cookie' => Cookie::class, + 'Crypt' => Crypt::class, + 'Date' => Date::class, + 'DB' => DB::class, + 'Eloquent' => Model::class, + 'Event' => Event::class, + 'File' => File::class, + 'Gate' => Gate::class, + 'Hash' => Hash::class, + 'Http' => Http::class, + 'Js' => Js::class, + 'Lang' => Lang::class, + 'Log' => Log::class, + 'Mail' => Mail::class, + 'Notification' => Notification::class, + 'Password' => Password::class, + 'Queue' => Queue::class, + 'RateLimiter' => RateLimiter::class, + 'Redirect' => Redirect::class, + 'Request' => Request::class, + 'Response' => Response::class, + 'Route' => Route::class, + 'Schema' => Schema::class, + 'Session' => Session::class, + 'Storage' => Storage::class, + 'Str' => Str::class, + 'URL' => URL::class, + 'Validator' => Validator::class, + 'View' => View::class, + ]); + } + /** * Get the application instance behind the facade. * diff --git a/vendor/illuminate/support/Facades/File.php b/vendor/illuminate/support/Facades/File.php index c22d363..56a3ba9 100644 --- a/vendor/illuminate/support/Facades/File.php +++ b/vendor/illuminate/support/Facades/File.php @@ -14,10 +14,12 @@ * @method static bool deleteDirectories(string $directory) * @method static bool deleteDirectory(string $directory, bool $preserve = false) * @method static bool exists(string $path) + * @method static bool hasSameHash(string $file, string $compared) * @method static bool isDirectory(string $directory) * @method static bool isFile(string $file) * @method static bool isReadable(string $path) * @method static bool isWritable(string $path) + * @method static bool isEmptyDirectory(string $directory, bool $ignoreDotFiles = false) * @method static bool makeDirectory(string $path, int $mode = 0755, bool $recursive = false, bool $force = false) * @method static bool missing(string $path) * @method static bool move(string $path, string $target) diff --git a/vendor/illuminate/support/Facades/Http.php b/vendor/illuminate/support/Facades/Http.php index d6f2f66..b90bd1a 100644 --- a/vendor/illuminate/support/Facades/Http.php +++ b/vendor/illuminate/support/Facades/Http.php @@ -6,7 +6,6 @@ /** * @method static \GuzzleHttp\Promise\PromiseInterface response($body = null, $status = 200, $headers = []) - * @method static \Illuminate\Http\Client\Factory fake($callback = null) * @method static \Illuminate\Http\Client\PendingRequest accept(string $contentType) * @method static \Illuminate\Http\Client\PendingRequest acceptJson() * @method static \Illuminate\Http\Client\PendingRequest asForm() @@ -17,10 +16,12 @@ * @method static \Illuminate\Http\Client\PendingRequest baseUrl(string $url) * @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback) * @method static \Illuminate\Http\Client\PendingRequest bodyFormat(string $format) + * @method static \Illuminate\Http\Client\PendingRequest connectTimeout(int $seconds) * @method static \Illuminate\Http\Client\PendingRequest contentType(string $contentType) * @method static \Illuminate\Http\Client\PendingRequest dd() * @method static \Illuminate\Http\Client\PendingRequest dump() - * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleep = 0, ?callable $when = null) + * @method static \Illuminate\Http\Client\PendingRequest retry(int $times, int $sleepMilliseconds = 0, ?callable $when = null, bool $throw = true) + * @method static \Illuminate\Http\Client\ResponseSequence sequence(array $responses = []) * @method static \Illuminate\Http\Client\PendingRequest sink(string|resource $to) * @method static \Illuminate\Http\Client\PendingRequest stub(callable $callback) * @method static \Illuminate\Http\Client\PendingRequest timeout(int $seconds) @@ -35,6 +36,9 @@ * @method static \Illuminate\Http\Client\PendingRequest withUserAgent(string $userAgent) * @method static \Illuminate\Http\Client\PendingRequest withoutRedirecting() * @method static \Illuminate\Http\Client\PendingRequest withoutVerifying() + * @method static \Illuminate\Http\Client\PendingRequest throw(callable $callback = null) + * @method static \Illuminate\Http\Client\PendingRequest throwIf($condition) + * @method \Illuminate\Http\Client\PendingRequest throwUnless($condition) * @method static array pool(callable $callback) * @method static \Illuminate\Http\Client\Response delete(string $url, array $data = []) * @method static \Illuminate\Http\Client\Response get(string $url, array|string|null $query = null) @@ -43,7 +47,7 @@ * @method static \Illuminate\Http\Client\Response post(string $url, array $data = []) * @method static \Illuminate\Http\Client\Response put(string $url, array $data = []) * @method static \Illuminate\Http\Client\Response send(string $method, string $url, array $options = []) - * @method static \Illuminate\Http\Client\ResponseSequence fakeSequence(string $urlPattern = '*') + * @method static \Illuminate\Http\Client\Factory allowStrayRequests() * @method static void assertSent(callable $callback) * @method static void assertSentInOrder(array $callbacks) * @method static void assertNotSent(callable $callback) @@ -64,4 +68,58 @@ protected static function getFacadeAccessor() { return Factory::class; } + + /** + * Register a stub callable that will intercept requests and be able to return stub responses. + * + * @param \Closure|array $callback + * @return \Illuminate\Http\Client\Factory + */ + public static function fake($callback = null) + { + return tap(static::getFacadeRoot(), function ($fake) use ($callback) { + static::swap($fake->fake($callback)); + }); + } + + /** + * Register a response sequence for the given URL pattern. + * + * @param string $urlPattern + * @return \Illuminate\Http\Client\ResponseSequence + */ + public static function fakeSequence(string $urlPattern = '*') + { + $fake = tap(static::getFacadeRoot(), function ($fake) { + static::swap($fake); + }); + + return $fake->fakeSequence($urlPattern); + } + + /** + * Indicate that an exception should be thrown if any request is not faked. + * + * @return \Illuminate\Http\Client\Factory + */ + public static function preventStrayRequests() + { + return tap(static::getFacadeRoot(), function ($fake) { + static::swap($fake->preventStrayRequests()); + }); + } + + /** + * Stub the given URL using the given callback. + * + * @param string $url + * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback + * @return \Illuminate\Http\Client\Factory + */ + public static function stubUrl($url, $callback) + { + return tap(static::getFacadeRoot(), function ($fake) use ($url, $callback) { + static::swap($fake->stubUrl($url, $callback)); + }); + } } diff --git a/vendor/illuminate/support/Facades/Log.php b/vendor/illuminate/support/Facades/Log.php index 68493fd..65bc6e7 100644 --- a/vendor/illuminate/support/Facades/Log.php +++ b/vendor/illuminate/support/Facades/Log.php @@ -8,6 +8,8 @@ * @method static \Psr\Log\LoggerInterface build(array $config) * @method static \Illuminate\Log\Logger withContext(array $context = []) * @method static \Illuminate\Log\Logger withoutContext() + * @method static \Illuminate\Log\LogManager shareContext(array $context) + * @method static array sharedContext() * @method static void alert(string $message, array $context = []) * @method static void critical(string $message, array $context = []) * @method static void debug(string $message, array $context = []) diff --git a/vendor/illuminate/support/Facades/Mail.php b/vendor/illuminate/support/Facades/Mail.php index 36796e7..b3e29e9 100644 --- a/vendor/illuminate/support/Facades/Mail.php +++ b/vendor/illuminate/support/Facades/Mail.php @@ -6,27 +6,32 @@ /** * @method static \Illuminate\Mail\Mailer mailer(string|null $name = null) + * @method static void alwaysFrom(string $address, string|null $name = null) + * @method static void alwaysReplyTo(string $address, string|null $name = null) + * @method static void alwaysReturnPath(string $address) + * @method static void alwaysTo(string $address, string|null $name = null) * @method static \Illuminate\Mail\PendingMail bcc($users) * @method static \Illuminate\Mail\PendingMail to($users) * @method static \Illuminate\Support\Collection queued(string $mailable, \Closure|string $callback = null) * @method static \Illuminate\Support\Collection sent(string $mailable, \Closure|string $callback = null) - * @method static array failures() + * @method static \Illuminate\Mail\SentMessage|null raw(string $text, $callback) + * @method static \Illuminate\Mail\SentMessage|null plain(string $view, array $data, $callback) + * @method static \Illuminate\Mail\SentMessage|null html(string $html, $callback) + * @method static \Illuminate\Mail\SentMessage|null send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null) * @method static bool hasQueued(string $mailable) * @method static bool hasSent(string $mailable) * @method static mixed later(\DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view, string $queue = null) * @method static mixed laterOn(string $queue, \DateTimeInterface|\DateInterval|int $delay, \Illuminate\Contracts\Mail\Mailable|string|array $view) * @method static mixed queue(\Illuminate\Contracts\Mail\Mailable|string|array $view, string $queue = null) * @method static mixed queueOn(string $queue, \Illuminate\Contracts\Mail\Mailable|string|array $view) - * @method static void assertNotQueued(string $mailable, callable $callback = null) - * @method static void assertNotSent(string $mailable, callable|int $callback = null) + * @method static void assertNotQueued(string|\Closure $mailable, callable|null $callback = null) + * @method static void assertNotSent(string|\Closure $mailable, callable|null $callback = null) + * @method static void assertNotOutgoing(string|\Closure $mailable, callable|null $callback = null) * @method static void assertNothingQueued() * @method static void assertNothingSent() + * @method static void assertNothingOutgoing() * @method static void assertQueued(string|\Closure $mailable, callable|int $callback = null) * @method static void assertSent(string|\Closure $mailable, callable|int $callback = null) - * @method static void raw(string $text, $callback) - * @method static void plain(string $view, array $data, $callback) - * @method static void html(string $html, $callback) - * @method static void send(\Illuminate\Contracts\Mail\Mailable|string|array $view, array $data = [], \Closure|string $callback = null) * * @see \Illuminate\Mail\Mailer * @see \Illuminate\Support\Testing\Fakes\MailFake diff --git a/vendor/illuminate/support/Facades/Notification.php b/vendor/illuminate/support/Facades/Notification.php index e16a9cc..68f7201 100644 --- a/vendor/illuminate/support/Facades/Notification.php +++ b/vendor/illuminate/support/Facades/Notification.php @@ -13,6 +13,7 @@ * @method static mixed channel(string|null $name = null) * @method static void assertNotSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null) * @method static void assertNothingSent() + * @method static void assertNothingSentTo(mixed $notifiable) * @method static void assertSentOnDemand(string|\Closure $notification, callable $callback = null) * @method static void assertSentTo(mixed $notifiable, string|\Closure $notification, callable $callback = null) * @method static void assertSentOnDemandTimes(string $notification, int $times = 1) diff --git a/vendor/illuminate/support/Facades/Queue.php b/vendor/illuminate/support/Facades/Queue.php index 5af1329..4b67884 100644 --- a/vendor/illuminate/support/Facades/Queue.php +++ b/vendor/illuminate/support/Facades/Queue.php @@ -42,11 +42,12 @@ public static function popUsing($workerName, $callback) /** * Replace the bound instance with a fake. * + * @param array|string $jobsToFake * @return \Illuminate\Support\Testing\Fakes\QueueFake */ - public static function fake() + public static function fake($jobsToFake = []) { - static::swap($fake = new QueueFake(static::getFacadeApplication())); + static::swap($fake = new QueueFake(static::getFacadeApplication(), $jobsToFake, static::getFacadeRoot())); return $fake; } diff --git a/vendor/illuminate/support/Facades/RateLimiter.php b/vendor/illuminate/support/Facades/RateLimiter.php index 5cfd784..3c33eb2 100644 --- a/vendor/illuminate/support/Facades/RateLimiter.php +++ b/vendor/illuminate/support/Facades/RateLimiter.php @@ -25,6 +25,6 @@ class RateLimiter extends Facade */ protected static function getFacadeAccessor() { - return 'Illuminate\Cache\RateLimiter'; + return \Illuminate\Cache\RateLimiter::class; } } diff --git a/vendor/illuminate/support/Facades/Redirect.php b/vendor/illuminate/support/Facades/Redirect.php index 19310ec..88e6b9a 100644 --- a/vendor/illuminate/support/Facades/Redirect.php +++ b/vendor/illuminate/support/Facades/Redirect.php @@ -3,17 +3,17 @@ namespace Illuminate\Support\Facades; /** - * @method static \Illuminate\Http\RedirectResponse action(string $action, array $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse action(string|array $action, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse away(string $path, int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse back(int $status = 302, array $headers = [], $fallback = false) * @method static \Illuminate\Http\RedirectResponse guest(string $path, int $status = 302, array $headers = [], bool $secure = null) * @method static \Illuminate\Http\RedirectResponse home(int $status = 302) * @method static \Illuminate\Http\RedirectResponse intended(string $default = '/', int $status = 302, array $headers = [], bool $secure = null) * @method static \Illuminate\Http\RedirectResponse refresh(int $status = 302, array $headers = []) - * @method static \Illuminate\Http\RedirectResponse route(string $route, array $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse route(string $route, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse secure(string $path, int $status = 302, array $headers = []) - * @method static \Illuminate\Http\RedirectResponse signedRoute(string $name, array $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, int $status = 302, array $headers = []) - * @method static \Illuminate\Http\RedirectResponse temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, array $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse signedRoute(string $name, mixed $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse temporarySignedRoute(string $name, \DateTimeInterface|\DateInterval|int $expiration, mixed $parameters = [], int $status = 302, array $headers = []) * @method static \Illuminate\Http\RedirectResponse to(string $path, int $status = 302, array $headers = [], bool $secure = null) * @method static \Illuminate\Routing\UrlGenerator getUrlGenerator() * @method static void setSession(\Illuminate\Session\Store $session) diff --git a/vendor/illuminate/support/Facades/Route.php b/vendor/illuminate/support/Facades/Route.php index 41a86c6..79f2c83 100644 --- a/vendor/illuminate/support/Facades/Route.php +++ b/vendor/illuminate/support/Facades/Route.php @@ -22,6 +22,7 @@ * @method static \Illuminate\Routing\Route substituteBindings(\Illuminate\Support\Facades\Route $route) * @method static \Illuminate\Routing\Route view(string $uri, string $view, array $data = [], int|array $status = 200, array $headers = []) * @method static \Illuminate\Routing\RouteRegistrar as(string $value) + * @method static \Illuminate\Routing\RouteRegistrar controller(string $controller) * @method static \Illuminate\Routing\RouteRegistrar domain(string $value) * @method static \Illuminate\Routing\RouteRegistrar middleware(array|string|null $middleware) * @method static \Illuminate\Routing\RouteRegistrar name(string $value) @@ -29,12 +30,14 @@ * @method static \Illuminate\Routing\RouteRegistrar prefix(string $prefix) * @method static \Illuminate\Routing\RouteRegistrar scopeBindings() * @method static \Illuminate\Routing\RouteRegistrar where(array $where) + * @method static \Illuminate\Routing\RouteRegistrar withoutMiddleware(array|string $middleware) * @method static \Illuminate\Routing\Router|\Illuminate\Routing\RouteRegistrar group(\Closure|string|array $attributes, \Closure|string $routes) * @method static \Illuminate\Routing\ResourceRegistrar resourceVerbs(array $verbs = []) * @method static string|null currentRouteAction() * @method static string|null currentRouteName() * @method static void apiResources(array $resources, array $options = []) * @method static void bind(string $key, string|callable $binder) + * @method static void macro(string $name, object|callable $macro) * @method static void model(string $key, string $class, \Closure|null $callback = null) * @method static void pattern(string $key, string $pattern) * @method static void resources(array $resources, array $options = []) diff --git a/vendor/illuminate/support/Facades/Schema.php b/vendor/illuminate/support/Facades/Schema.php index 896e176..a2ccda7 100644 --- a/vendor/illuminate/support/Facades/Schema.php +++ b/vendor/illuminate/support/Facades/Schema.php @@ -15,15 +15,27 @@ * @method static bool hasColumn(string $table, string $column) * @method static bool hasColumns(string $table, array $columns) * @method static bool dropColumns(string $table, array $columns) + * @method static void whenTableHasColumn(string $table, string $column, \Closure $callback) + * @method static void whenTableDoesntHaveColumn(string $table, string $column, \Closure $callback) * @method static bool hasTable(string $table) * @method static void defaultStringLength(int $length) - * @method static void registerCustomDoctrineType(string $class, string $name, string $type) * @method static array getColumnListing(string $table) + * @method static string getColumnType(string $table, string $column) + * @method static void morphUsingUuids() + * @method static \Illuminate\Database\Connection getConnection() + * @method static \Illuminate\Database\Schema\Builder setConnection(\Illuminate\Database\Connection $connection) * * @see \Illuminate\Database\Schema\Builder */ class Schema extends Facade { + /** + * Indicates if the resolved facade should be cached. + * + * @var bool + */ + protected static $cached = false; + /** * Get a schema builder instance for a connection. * @@ -36,12 +48,12 @@ public static function connection($name) } /** - * Get a schema builder instance for the default connection. + * Get the registered name of the component. * - * @return \Illuminate\Database\Schema\Builder + * @return string */ protected static function getFacadeAccessor() { - return static::$app['db']->connection()->getSchemaBuilder(); + return 'db.schema'; } } diff --git a/vendor/illuminate/support/Facades/Storage.php b/vendor/illuminate/support/Facades/Storage.php index e12fde6..9dbf884 100644 --- a/vendor/illuminate/support/Facades/Storage.php +++ b/vendor/illuminate/support/Facades/Storage.php @@ -6,6 +6,7 @@ /** * @method static \Illuminate\Contracts\Filesystem\Filesystem assertExists(string|array $path) + * @method static \Illuminate\Contracts\Filesystem\Filesystem assertDirectoryEmpty(string $path) * @method static \Illuminate\Contracts\Filesystem\Filesystem assertMissing(string|array $path) * @method static \Illuminate\Contracts\Filesystem\Filesystem cloud() * @method static \Illuminate\Contracts\Filesystem\Filesystem build(string|array $root) @@ -40,6 +41,8 @@ * @method static string|false mimeType(string $path) * @method static string|false putFile(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, mixed $options = []) * @method static string|false putFileAs(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, string $name, mixed $options = []) + * @method static void macro(string $name, object|callable $macro) + * @method static void buildTemporaryUrlsUsing(\Closure $callback) * * @see \Illuminate\Filesystem\FilesystemManager */ @@ -68,7 +71,9 @@ public static function fake($disk = null, array $config = []) 'root' => $root, ]))); - return $fake; + return tap($fake)->buildTemporaryUrlsUsing(function ($path, $expiration) { + return URL::to($path.'?expiration='.$expiration->getTimestamp()); + }); } /** diff --git a/vendor/illuminate/support/Facades/URL.php b/vendor/illuminate/support/Facades/URL.php index 7d9941d..9e29358 100644 --- a/vendor/illuminate/support/Facades/URL.php +++ b/vendor/illuminate/support/Facades/URL.php @@ -13,6 +13,7 @@ * @method static void macro(string $name, object|callable $macro) * @method static void mixin(object $mixin, bool $replace = true) * @method static string previous($fallback = false) + * @method static string previousPath($fallback = false) * @method static string route(string $name, $parameters = [], bool $absolute = true) * @method static string secure(string $path, array $parameters = []) * @method static string signedRoute(string $name, array $parameters = [], \DateTimeInterface|\DateInterval|int $expiration = null, bool $absolute = true) diff --git a/vendor/illuminate/support/Facades/Validator.php b/vendor/illuminate/support/Facades/Validator.php index f12cb38..0141277 100644 --- a/vendor/illuminate/support/Facades/Validator.php +++ b/vendor/illuminate/support/Facades/Validator.php @@ -4,6 +4,8 @@ /** * @method static \Illuminate\Contracts\Validation\Validator make(array $data, array $rules, array $messages = [], array $customAttributes = []) + * @method static void includeUnvalidatedArrayKeys() + * @method static void excludeUnvalidatedArrayKeys() * @method static void extend(string $rule, \Closure|string $extension, string $message = null) * @method static void extendImplicit(string $rule, \Closure|string $extension, string $message = null) * @method static void replacer(string $rule, \Closure|string $replacer) diff --git a/vendor/illuminate/support/Facades/View.php b/vendor/illuminate/support/Facades/View.php index 4988ee9..1c562a1 100644 --- a/vendor/illuminate/support/Facades/View.php +++ b/vendor/illuminate/support/Facades/View.php @@ -13,6 +13,7 @@ * @method static array creator(array|string $views, \Closure|string $callback) * @method static bool exists(string $view) * @method static mixed share(array|string $key, $value = null) + * @method static mixed shared(string $key, $default = null) * * @see \Illuminate\View\Factory */ diff --git a/vendor/illuminate/support/Fluent.php b/vendor/illuminate/support/Fluent.php index 4660283..f7e67c9 100644 --- a/vendor/illuminate/support/Fluent.php +++ b/vendor/illuminate/support/Fluent.php @@ -7,19 +7,26 @@ use Illuminate\Contracts\Support\Jsonable; use JsonSerializable; +/** + * @template TKey of array-key + * @template TValue + * + * @implements \Illuminate\Contracts\Support\Arrayable + * @implements \ArrayAccess + */ class Fluent implements Arrayable, ArrayAccess, Jsonable, JsonSerializable { /** * All of the attributes set on the fluent instance. * - * @var array + * @var array */ protected $attributes = []; /** * Create a new fluent instance. * - * @param array|object $attributes + * @param iterable $attributes * @return void */ public function __construct($attributes = []) @@ -32,9 +39,11 @@ public function __construct($attributes = []) /** * Get an attribute from the fluent instance. * - * @param string $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) { @@ -48,7 +57,7 @@ public function get($key, $default = null) /** * Get the attributes from the fluent instance. * - * @return array + * @return array */ public function getAttributes() { @@ -58,7 +67,7 @@ public function getAttributes() /** * Convert the fluent instance to an array. * - * @return array + * @return array */ public function toArray() { @@ -68,10 +77,9 @@ public function toArray() /** * Convert the object into something JSON serializable. * - * @return array + * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } @@ -90,11 +98,10 @@ public function toJson($options = 0) /** * Determine if the given offset exists. * - * @param string $offset + * @param TKey $offset * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->attributes[$offset]); } @@ -102,11 +109,10 @@ public function offsetExists($offset) /** * Get the value for a given offset. * - * @param string $offset - * @return mixed + * @param TKey $offset + * @return TValue|null */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->get($offset); } @@ -114,12 +120,11 @@ public function offsetGet($offset) /** * Set the value at the given offset. * - * @param string $offset - * @param mixed $value + * @param TKey $offset + * @param TValue $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->attributes[$offset] = $value; } @@ -127,11 +132,10 @@ public function offsetSet($offset, $value) /** * Unset the value at the given offset. * - * @param string $offset + * @param TKey $offset * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->attributes[$offset]); } @@ -139,8 +143,8 @@ public function offsetUnset($offset) /** * Handle dynamic calls to the fluent instance to set attributes. * - * @param string $method - * @param array $parameters + * @param TKey $method + * @param array{0: ?TValue} $parameters * @return $this */ public function __call($method, $parameters) @@ -153,8 +157,8 @@ public function __call($method, $parameters) /** * Dynamically retrieve the value of an attribute. * - * @param string $key - * @return mixed + * @param TKey $key + * @return TValue|null */ public function __get($key) { @@ -164,8 +168,8 @@ public function __get($key) /** * Dynamically set the value of an attribute. * - * @param string $key - * @param mixed $value + * @param TKey $key + * @param TValue $value * @return void */ public function __set($key, $value) @@ -176,7 +180,7 @@ public function __set($key, $value) /** * Dynamically check if an attribute is set. * - * @param string $key + * @param TKey $key * @return bool */ public function __isset($key) @@ -187,7 +191,7 @@ public function __isset($key) /** * Dynamically unset an attribute. * - * @param string $key + * @param TKey $key * @return void */ public function __unset($key) diff --git a/vendor/illuminate/support/Js.php b/vendor/illuminate/support/Js.php index 6d6de34..5a1d23a 100644 --- a/vendor/illuminate/support/Js.php +++ b/vendor/illuminate/support/Js.php @@ -112,7 +112,7 @@ protected function jsonEncode($data, $flags = 0, $depth = 512) */ protected function convertJsonToJavaScriptExpression($json, $flags = 0) { - if ('[]' === $json || '{}' === $json) { + if ($json === '[]' || $json === '{}') { return $json; } diff --git a/vendor/illuminate/support/MessageBag.php b/vendor/illuminate/support/MessageBag.php index e53d509..cfc6d88 100644 --- a/vendor/illuminate/support/MessageBag.php +++ b/vendor/illuminate/support/MessageBag.php @@ -193,7 +193,7 @@ public function get($key, $format = null) ); } - if (Str::contains($key, '*')) { + if (str_contains($key, '*')) { return $this->getMessagesForWildcardKey($key, $format); } @@ -368,8 +368,7 @@ public function any() * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->messages, COUNT_RECURSIVE) - count($this->messages); } @@ -389,8 +388,7 @@ public function toArray() * * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->toArray(); } diff --git a/vendor/illuminate/support/MultipleInstanceManager.php b/vendor/illuminate/support/MultipleInstanceManager.php new file mode 100644 index 0000000..8544bdf --- /dev/null +++ b/vendor/illuminate/support/MultipleInstanceManager.php @@ -0,0 +1,191 @@ +app = $app; + } + + /** + * Get the default instance name. + * + * @return string + */ + abstract public function getDefaultInstance(); + + /** + * Set the default instance name. + * + * @param string $name + * @return void + */ + abstract public function setDefaultInstance($name); + + /** + * Get the instance specific configuration. + * + * @param string $name + * @return array + */ + abstract public function getInstanceConfig($name); + + /** + * Get an instance instance by name. + * + * @param string|null $name + * @return mixed + */ + public function instance($name = null) + { + $name = $name ?: $this->getDefaultInstance(); + + return $this->instances[$name] = $this->get($name); + } + + /** + * Attempt to get an instance from the local cache. + * + * @param string $name + * @return mixed + */ + protected function get($name) + { + return $this->instances[$name] ?? $this->resolve($name); + } + + /** + * Resolve the given instance. + * + * @param string $name + * @return mixed + * + * @throws \InvalidArgumentException + */ + protected function resolve($name) + { + $config = $this->getInstanceConfig($name); + + if (is_null($config)) { + throw new InvalidArgumentException("Instance [{$name}] is not defined."); + } + + if (! array_key_exists('driver', $config)) { + throw new RuntimeException("Instance [{$name}] does not specify a driver."); + } + + if (isset($this->customCreators[$config['driver']])) { + return $this->callCustomCreator($config); + } else { + $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; + + if (method_exists($this, $driverMethod)) { + return $this->{$driverMethod}($config); + } else { + throw new InvalidArgumentException("Instance driver [{$config['driver']}] is not supported."); + } + } + } + + /** + * Call a custom instance creator. + * + * @param array $config + * @return mixed + */ + protected function callCustomCreator(array $config) + { + return $this->customCreators[$config['driver']]($this->app, $config); + } + + /** + * Unset the given instances. + * + * @param array|string|null $name + * @return $this + */ + public function forgetInstance($name = null) + { + $name ??= $this->getDefaultInstance(); + + foreach ((array) $name as $instanceName) { + if (isset($this->instances[$instanceName])) { + unset($this->instances[$instanceName]); + } + } + + return $this; + } + + /** + * Disconnect the given instance and remove from local cache. + * + * @param string|null $name + * @return void + */ + public function purge($name = null) + { + $name ??= $this->getDefaultInstance(); + + unset($this->instances[$name]); + } + + /** + * Register a custom instance creator Closure. + * + * @param string $name + * @param \Closure $callback + * @return $this + */ + public function extend($name, Closure $callback) + { + $this->customCreators[$name] = $callback->bindTo($this, $this); + + return $this; + } + + /** + * Dynamically call the default instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->instance()->$method(...$parameters); + } +} diff --git a/vendor/illuminate/support/NamespacedItemResolver.php b/vendor/illuminate/support/NamespacedItemResolver.php index a0d8508..a059c6d 100644 --- a/vendor/illuminate/support/NamespacedItemResolver.php +++ b/vendor/illuminate/support/NamespacedItemResolver.php @@ -29,7 +29,7 @@ public function parseKey($key) // If the key does not contain a double colon, it means the key is not in a // namespace, and is just a regular configuration item. Namespaces are a // tool for organizing configuration items for things such as modules. - if (strpos($key, '::') === false) { + if (! str_contains($key, '::')) { $segments = explode('.', $key); $parsed = $this->parseBasicSegments($segments); diff --git a/vendor/illuminate/support/Optional.php b/vendor/illuminate/support/Optional.php index 816190d..ba84a2c 100644 --- a/vendor/illuminate/support/Optional.php +++ b/vendor/illuminate/support/Optional.php @@ -68,8 +68,7 @@ public function __isset($name) * @param mixed $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return Arr::accessible($this->value) && Arr::exists($this->value, $key); } @@ -80,8 +79,7 @@ public function offsetExists($key) * @param mixed $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return Arr::get($this->value, $key); } @@ -93,8 +91,7 @@ public function offsetGet($key) * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { if (Arr::accessible($this->value)) { $this->value[$key] = $value; @@ -107,8 +104,7 @@ public function offsetSet($key, $value) * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { if (Arr::accessible($this->value)) { unset($this->value[$key]); diff --git a/vendor/illuminate/support/Pluralizer.php b/vendor/illuminate/support/Pluralizer.php index 5dbd8a0..9a9228c 100644 --- a/vendor/illuminate/support/Pluralizer.php +++ b/vendor/illuminate/support/Pluralizer.php @@ -2,62 +2,36 @@ namespace Illuminate\Support; -use Doctrine\Inflector\CachedWordInflector; -use Doctrine\Inflector\Inflector; -use Doctrine\Inflector\Rules\English; -use Doctrine\Inflector\RulesetInflector; +use Doctrine\Inflector\InflectorFactory; class Pluralizer { /** - * Uncountable word forms. + * The cached inflector instance. + * + * @var static + */ + protected static $inflector; + + /** + * The language that should be used by the inflector. + * + * @var string + */ + protected static $language = 'english'; + + /** + * Uncountable non-nouns word forms. + * + * Contains words supported by Doctrine/Inflector/Rules/English/Uninflected.php * * @var string[] */ public static $uncountable = [ - 'audio', - 'bison', 'cattle', - 'chassis', - 'compensation', - 'coreopsis', - 'data', - 'deer', - 'education', - 'emoji', - 'equipment', - 'evidence', - 'feedback', - 'firmware', - 'fish', - 'furniture', - 'gold', - 'hardware', - 'information', - 'jedi', 'kin', - 'knowledge', - 'love', - 'metadata', - 'money', - 'moose', - 'news', - 'nutrition', - 'offspring', - 'plankton', - 'pokemon', - 'police', - 'rain', 'recommended', 'related', - 'rice', - 'series', - 'sheep', - 'software', - 'species', - 'swine', - 'traffic', - 'wheat', ]; /** @@ -133,19 +107,23 @@ protected static function matchCase($value, $comparison) */ public static function inflector() { - static $inflector; - - if (is_null($inflector)) { - $inflector = new Inflector( - new CachedWordInflector(new RulesetInflector( - English\Rules::getSingularRuleset() - )), - new CachedWordInflector(new RulesetInflector( - English\Rules::getPluralRuleset() - )) - ); + if (is_null(static::$inflector)) { + static::$inflector = InflectorFactory::createForLanguage(static::$language)->build(); } - return $inflector; + return static::$inflector; + } + + /** + * Specify the language that should be used by the inflector. + * + * @param string $language + * @return void + */ + public static function useLanguage(string $language) + { + static::$language = $language; + + static::$inflector = null; } } diff --git a/vendor/illuminate/support/ProcessUtils.php b/vendor/illuminate/support/ProcessUtils.php index 1caa9e1..165e751 100644 --- a/vendor/illuminate/support/ProcessUtils.php +++ b/vendor/illuminate/support/ProcessUtils.php @@ -22,7 +22,7 @@ public static function escapeArgument($argument) // @see https://bugs.php.net/bug.php?id=43784 // @see https://bugs.php.net/bug.php?id=49446 if ('\\' === DIRECTORY_SEPARATOR) { - if ('' === $argument) { + if ($argument === '') { return '""'; } @@ -30,14 +30,14 @@ public static function escapeArgument($argument) $quote = false; foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { - if ('"' === $part) { + if ($part === '"') { $escapedArgument .= '\\"'; } elseif (self::isSurroundedBy($part, '%')) { // Avoid environment variable expansion $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; } else { // escape trailing backslash - if ('\\' === substr($part, -1)) { + if (str_ends_with($part, '\\')) { $part .= '\\'; } $quote = true; @@ -64,6 +64,6 @@ public static function escapeArgument($argument) */ protected static function isSurroundedBy($arg, $char) { - return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; + return strlen($arg) > 2 && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; } } diff --git a/vendor/illuminate/support/Reflector.php b/vendor/illuminate/support/Reflector.php index 9e7896a..1390c9d 100644 --- a/vendor/illuminate/support/Reflector.php +++ b/vendor/illuminate/support/Reflector.php @@ -3,6 +3,7 @@ namespace Illuminate\Support; use ReflectionClass; +use ReflectionEnum; use ReflectionMethod; use ReflectionNamedType; use ReflectionUnionType; @@ -22,8 +23,7 @@ public static function isCallable($var, $syntaxOnly = false) return is_callable($var, $syntaxOnly); } - if ((! isset($var[0]) || ! isset($var[1])) || - ! is_string($var[1] ?? null)) { + if (! isset($var[0], $var[1]) || ! is_string($var[1] ?? null)) { return false; } @@ -135,8 +135,28 @@ public static function isParameterSubclassOf($parameter, $className) { $paramClassName = static::getParameterClassName($parameter); - return ($paramClassName && class_exists($paramClassName)) - ? (new ReflectionClass($paramClassName))->isSubclassOf($className) - : false; + return $paramClassName + && (class_exists($paramClassName) || interface_exists($paramClassName)) + && (new ReflectionClass($paramClassName))->isSubclassOf($className); + } + + /** + * Determine if the parameter's type is a Backed Enum with a string backing type. + * + * @param \ReflectionParameter $parameter + * @return bool + */ + public static function isParameterBackedEnumWithStringBackingType($parameter) + { + $backedEnumClass = (string) $parameter->getType(); + + if (function_exists('enum_exists') && enum_exists($backedEnumClass)) { + $reflectionBackedEnum = new ReflectionEnum($backedEnumClass); + + return $reflectionBackedEnum->isBacked() + && $reflectionBackedEnum->getBackingType()->getName() == 'string'; + } + + return false; } } diff --git a/vendor/illuminate/support/Str.php b/vendor/illuminate/support/Str.php index 5799c63..eb37942 100644 --- a/vendor/illuminate/support/Str.php +++ b/vendor/illuminate/support/Str.php @@ -2,7 +2,9 @@ namespace Illuminate\Support; +use Closure; use Illuminate\Support\Traits\Macroable; +use JsonException; use League\CommonMark\GithubFlavoredMarkdownConverter; use Ramsey\Uuid\Codec\TimestampFirstCombCodec; use Ramsey\Uuid\Generator\CombGenerator; @@ -38,10 +40,17 @@ class Str /** * The callback that should be used to generate UUIDs. * - * @var callable + * @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. * @@ -99,6 +108,19 @@ 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. * @@ -156,6 +178,23 @@ public static function between($subject, $from, $to) 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. * @@ -176,12 +215,18 @@ public static function camel($value) * * @param string $haystack * @param string|string[] $needles + * @param bool $ignoreCase * @return bool */ - public static function contains($haystack, $needles) + 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 !== '' && mb_strpos($haystack, $needle) !== false) { + if ($needle !== '' && str_contains($haystack, $needle)) { return true; } } @@ -194,10 +239,16 @@ public static function contains($haystack, $needles) * * @param string $haystack * @param string[] $needles + * @param bool $ignoreCase * @return bool */ - public static function containsAll($haystack, array $needles) + public static function containsAll($haystack, array $needles, $ignoreCase = false) { + if ($ignoreCase) { + $haystack = mb_strtolower($haystack); + $needles = array_map('mb_strtolower', $needles); + } + foreach ($needles as $needle) { if (! static::contains($haystack, $needle)) { return false; @@ -217,10 +268,7 @@ public static function containsAll($haystack, array $needles) public static function endsWith($haystack, $needles) { foreach ((array) $needles as $needle) { - if ( - $needle !== '' && $needle !== null - && substr($haystack, -strlen($needle)) === (string) $needle - ) { + if ((string) $needle !== '' && str_ends_with($haystack, $needle)) { return true; } } @@ -228,6 +276,42 @@ public static function endsWith($haystack, $needles) 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. * @@ -265,7 +349,7 @@ public static function is($pattern, $value) // 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) { + if ($pattern === $value) { return true; } @@ -295,6 +379,27 @@ 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. * @@ -395,7 +500,7 @@ public static function markdown($string, array $options = []) { $converter = new GithubFlavoredMarkdownConverter($options); - return (string) $converter->convertToHtml($string); + return (string) $converter->convert($string); } /** @@ -414,20 +519,24 @@ public static function mask($string, $character, $index, $length = null, $encodi return $string; } - if (is_null($length) && PHP_MAJOR_VERSION < 8) { - $length = mb_strlen($string, $encoding); - } - $segment = mb_substr($string, $index, $length, $encoding); if ($segment === '') { return $string; } - $start = mb_substr($string, 0, mb_strpos($string, $segment, 0, $encoding), $encoding); - $end = mb_substr($string, mb_strpos($string, $segment, 0, $encoding) + mb_strlen($segment, $encoding)); + $strlen = mb_strlen($string, $encoding); + $startIndex = $index; + + if ($index < 0) { + $startIndex = $index < -$strlen ? 0 : $strlen + $index; + } - return $start.str_repeat(mb_substr($character, 0, 1, $encoding), mb_strlen($segment, $encoding)).$end; + $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; } /** @@ -476,7 +585,7 @@ public static function matchAll($pattern, $subject) */ public static function padBoth($value, $length, $pad = ' ') { - return str_pad($value, $length, $pad, STR_PAD_BOTH); + return str_pad($value, strlen($value) - mb_strlen($value) + $length, $pad, STR_PAD_BOTH); } /** @@ -489,7 +598,7 @@ public static function padBoth($value, $length, $pad = ' ') */ public static function padLeft($value, $length, $pad = ' ') { - return str_pad($value, $length, $pad, STR_PAD_LEFT); + return str_pad($value, strlen($value) - mb_strlen($value) + $length, $pad, STR_PAD_LEFT); } /** @@ -502,7 +611,7 @@ public static function padLeft($value, $length, $pad = ' ') */ public static function padRight($value, $length, $pad = ' ') { - return str_pad($value, $length, $pad, STR_PAD_RIGHT); + return str_pad($value, strlen($value) - mb_strlen($value) + $length, $pad, STR_PAD_RIGHT); } /** @@ -553,17 +662,74 @@ public static function pluralStudly($value, $count = 2) */ public static function random($length = 16) { - $string = ''; + return (static::$randomStringFactory ?? function ($length) { + $string = ''; - while (($len = strlen($string)) < $length) { - $size = $length - $len; + while (($len = strlen($string)) < $length) { + $size = $length - $len; - $bytes = random_bytes($size); + $bytes = random_bytes($size); - $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); - } + $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; - return $string; + $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; } /** @@ -622,6 +788,8 @@ public static function replace($search, $replace, $subject) */ public static function replaceFirst($search, $replace, $subject) { + $search = (string) $search; + if ($search === '') { return $subject; } @@ -730,17 +898,15 @@ public static function title($value) */ public static function headline($value) { - $parts = explode('_', static::replace(' ', '_', $value)); + $parts = explode(' ', $value); - if (count($parts) > 1) { - $parts = array_map([static::class, 'title'], $parts); - } - - $studly = static::studly(implode($parts)); + $parts = count($parts) > 1 + ? array_map([static::class, 'title'], $parts) + : array_map([static::class, 'title'], static::ucsplit(implode('_', $parts))); - $words = preg_split('/(?=[A-Z])/', $studly, -1, PREG_SPLIT_NO_EMPTY); + $collapsed = static::replace(['-', '_', ' '], '_', implode('_', $parts)); - return implode(' ', $words); + return implode(' ', array_filter(explode('_', $collapsed))); } /** @@ -807,6 +973,17 @@ public static function snake($value, $delimiter = '_') 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]+|[\s]+$~u', '', $value)); + } + /** * Determine if a given string starts with a given substring. * @@ -817,7 +994,7 @@ public static function snake($value, $delimiter = '_') public static function startsWith($haystack, $needles) { foreach ((array) $needles as $needle) { - if ((string) $needle !== '' && strncmp($haystack, $needle, strlen($needle)) === 0) { + if ((string) $needle !== '' && str_starts_with($haystack, $needle)) { return true; } } @@ -839,9 +1016,11 @@ public static function studly($value) return static::$studlyCache[$key]; } - $value = ucwords(str_replace(['-', '_'], ' ', $value)); + $words = explode(' ', static::replace(['-', '_'], ' ', $value)); + + $studlyWords = array_map(fn ($word) => static::ucfirst($word), $words); - return static::$studlyCache[$key] = str_replace(' ', '', $value); + return static::$studlyCache[$key] = implode($studlyWords); } /** @@ -875,6 +1054,47 @@ public static function substrCount($haystack, $needle, $offset = 0, $length = nu } } + /** + * Replace text within a portion of a string. + * + * @param string|array $string + * @param string|array $replace + * @param array|int $offset + * @param array|int|null $length + * @return string|array + */ + 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. * @@ -886,15 +1106,27 @@ 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 array + */ + 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) + public static function wordCount($string, $characters = null) { - return str_word_count($string); + return str_word_count($string, 0, $characters); } /** @@ -945,6 +1177,61 @@ 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) { + $callback($uuid); + + Str::createUuidsNormally(); + } + + return $uuid; + } + /** * Indicate that UUIDs should be created normally and not using a custom factory. * @@ -954,4 +1241,16 @@ public static function createUuidsNormally() { static::$uuidFactory = null; } + + /** + * Remove all strings from the casing caches. + * + * @return void + */ + public static function flushCache() + { + static::$snakeCache = []; + static::$camelCache = []; + static::$studlyCache = []; + } } diff --git a/vendor/illuminate/support/Stringable.php b/vendor/illuminate/support/Stringable.php index 1927112..1ba00aa 100644 --- a/vendor/illuminate/support/Stringable.php +++ b/vendor/illuminate/support/Stringable.php @@ -64,6 +64,17 @@ public function append(...$values) return new static($this->value.implode('', $values)); } + /** + * Append a new line to the string. + * + * @param int $count + * @return $this + */ + public function newLine($count = 1) + { + return $this->append(str_repeat(PHP_EOL, $count)); + } + /** * Transliterate a UTF-8 value to ASCII. * @@ -130,6 +141,18 @@ public function between($from, $to) return new static(Str::between($this->value, $from, $to)); } + /** + * Get the smallest possible portion of a string between two given values. + * + * @param string $from + * @param string $to + * @return static + */ + public function betweenFirst($from, $to) + { + return new static(Str::betweenFirst($this->value, $from, $to)); + } + /** * Convert a value to camel case. * @@ -143,7 +166,7 @@ public function camel() /** * Determine if a given string contains a given substring. * - * @param string|array $needles + * @param string|string[] $needles * @return bool */ public function contains($needles) @@ -176,7 +199,7 @@ public function dirname($levels = 1) /** * Determine if a given string ends with a given substring. * - * @param string|array $needles + * @param string|string[] $needles * @return bool */ public function endsWith($needles) @@ -187,14 +210,30 @@ public function endsWith($needles) /** * Determine if the string is an exact match with the given value. * - * @param string $value + * @param \Illuminate\Support\Stringable|string $value * @return bool */ public function exactly($value) { + if ($value instanceof Stringable) { + $value = $value->toString(); + } + return $this->value === $value; } + /** + * Extracts an excerpt from text that matches the first instance of a phrase. + * + * @param string $phrase + * @param array $options + * @return string|null + */ + public function excerpt($phrase = '', $options = []) + { + return Str::excerpt($this->value, $phrase, $options); + } + /** * Explode the string into an array. * @@ -258,6 +297,16 @@ public function isAscii() return Str::isAscii($this->value); } + /** + * Determine if a given string is valid JSON. + * + * @return bool + */ + public function isJson() + { + return Str::isJson($this->value); + } + /** * Determine if a given string is a valid UUID. * @@ -444,7 +493,7 @@ public function parseCallback($default = null) */ public function pipe(callable $callback) { - return new static(call_user_func($callback, $this)); + return new static($callback($this)); } /** @@ -510,7 +559,7 @@ public function reverse() */ public function repeat(int $times) { - return new static(Str::repeat($this->value, $times)); + return new static(str_repeat($this->value, $times)); } /** @@ -522,7 +571,7 @@ public function repeat(int $times) */ public function replace($search, $replace) { - return new static(Str::replace($search, $replace, $this->value)); + return new static(str_replace($search, $replace, $this->value)); } /** @@ -578,6 +627,27 @@ public function replaceMatches($pattern, $replace, $limit = -1) return new static(preg_replace($pattern, $replace, $this->value, $limit)); } + /** + * Parse input from a string to a collection, according to a format. + * + * @param string $format + * @return \Illuminate\Support\Collection + */ + public function scan($format) + { + return collect(sscanf($this->value, $format)); + } + + /** + * Remove all "extra" blank space from the given string. + * + * @return static + */ + public function squish() + { + return new static(Str::squish($this->value)); + } + /** * Begin a string with a single instance of a given value. * @@ -666,7 +736,7 @@ public function snake($delimiter = '_') /** * Determine if a given string starts with a given substring. * - * @param string|array $needles + * @param string|string[] $needles * @return bool */ public function startsWith($needles) @@ -709,6 +779,30 @@ public function substrCount($needle, $offset = null, $length = null) return Str::substrCount($this->value, $needle, $offset ?? 0, $length); } + /** + * Replace text within a portion of a string. + * + * @param string|array $replace + * @param array|int $offset + * @param array|int|null $length + * @return static + */ + public function substrReplace($replace, $offset = 0, $length = null) + { + return new static(Str::substrReplace($this->value, $replace, $offset, $length)); + } + + /** + * Swap multiple keywords in a string with other keywords. + * + * @param array $map + * @return static + */ + public function swap(array $map) + { + return new static(strtr($this->value, $map)); + } + /** * Trim the string of the given characters. * @@ -742,6 +836,16 @@ public function rtrim($characters = null) return new static(rtrim(...array_merge([$this->value], func_get_args()))); } + /** + * Make a string's first character lowercase. + * + * @return static + */ + public function lcfirst() + { + return new static(Str::lcfirst($this->value)); + } + /** * Make a string's first character uppercase. * @@ -753,37 +857,152 @@ public function ucfirst() } /** - * Execute the given callback if the string is empty. + * Split a string by uppercase characters. * + * @return \Illuminate\Support\Collection + */ + public function ucsplit() + { + return collect(Str::ucsplit($this->value)); + } + + /** + * Execute the given callback if the string contains a given substring. + * + * @param string|string[] $needles * @param callable $callback + * @param callable|null $default * @return static */ - public function whenEmpty($callback) + public function whenContains($needles, $callback, $default = null) { - if ($this->isEmpty()) { - $result = $callback($this); + return $this->when($this->contains($needles), $callback, $default); + } - return is_null($result) ? $this : $result; - } + /** + * Execute the given callback if the string contains all array values. + * + * @param array $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenContainsAll(array $needles, $callback, $default = null) + { + return $this->when($this->containsAll($needles), $callback, $default); + } - return $this; + /** + * Execute the given callback if the string is empty. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenEmpty($callback, $default = null) + { + return $this->when($this->isEmpty(), $callback, $default); } /** * Execute the given callback if the string is not empty. * * @param callable $callback + * @param callable|null $default * @return static */ - public function whenNotEmpty($callback) + public function whenNotEmpty($callback, $default = null) { - if ($this->isNotEmpty()) { - $result = $callback($this); + return $this->when($this->isNotEmpty(), $callback, $default); + } - return is_null($result) ? $this : $result; - } + /** + * Execute the given callback if the string ends with a given substring. + * + * @param string|string[] $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenEndsWith($needles, $callback, $default = null) + { + return $this->when($this->endsWith($needles), $callback, $default); + } - return $this; + /** + * Execute the given callback if the string is an exact match with the given value. + * + * @param string $value + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenExactly($value, $callback, $default = null) + { + return $this->when($this->exactly($value), $callback, $default); + } + + /** + * Execute the given callback if the string matches a given pattern. + * + * @param string|array $pattern + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIs($pattern, $callback, $default = null) + { + return $this->when($this->is($pattern), $callback, $default); + } + + /** + * Execute the given callback if the string is 7 bit ASCII. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsAscii($callback, $default = null) + { + return $this->when($this->isAscii(), $callback, $default); + } + + /** + * Execute the given callback if the string is a valid UUID. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsUuid($callback, $default = null) + { + return $this->when($this->isUuid(), $callback, $default); + } + + /** + * Execute the given callback if the string starts with a given substring. + * + * @param string|string[] $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenStartsWith($needles, $callback, $default = null) + { + return $this->when($this->startsWith($needles), $callback, $default); + } + + /** + * Execute the given callback if the string matches the given pattern. + * + * @param string $pattern + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenTest($pattern, $callback, $default = null) + { + return $this->when($this->test($pattern), $callback, $default); } /** @@ -808,6 +1027,28 @@ public function wordCount() return str_word_count($this->value); } + /** + * Wrap the string with the given strings. + * + * @param string $before + * @param string|null $after + * @return static + */ + public function wrap($before, $after = null) + { + return new static($before.$this->value.($after ??= $before)); + } + + /** + * Convert the string into a `HtmlString` instance. + * + * @return \Illuminate\Support\HtmlString + */ + public function toHtmlString() + { + return new HtmlString($this->value); + } + /** * Dump the string. * @@ -832,13 +1073,32 @@ public function dd() exit(1); } + /** + * Get the underlying string value. + * + * @return string + */ + public function value() + { + return $this->toString(); + } + + /** + * Get the underlying string value. + * + * @return string + */ + public function toString() + { + return $this->value; + } + /** * Convert the object to a string when JSON encoded. * * @return string */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): string { return $this->__toString(); } diff --git a/vendor/illuminate/support/Testing/Fakes/BusFake.php b/vendor/illuminate/support/Testing/Fakes/BusFake.php index 52a9530..d323a13 100644 --- a/vendor/illuminate/support/Testing/Fakes/BusFake.php +++ b/vendor/illuminate/support/Testing/Fakes/BusFake.php @@ -223,7 +223,7 @@ public function assertDispatchedAfterResponse($command, $callback = null) PHPUnit::assertTrue( $this->dispatchedAfterResponse($command, $callback)->count() > 0, - "The expected [{$command}] job was not dispatched for after sending the response." + "The expected [{$command}] job was not dispatched after sending the response." ); } @@ -259,7 +259,7 @@ public function assertNotDispatchedAfterResponse($command, $callback = null) PHPUnit::assertCount( 0, $this->dispatchedAfterResponse($command, $callback), - "The unexpected [{$command}] job was dispatched for after sending the response." + "The unexpected [{$command}] job was dispatched after sending the response." ); } @@ -351,14 +351,12 @@ public function assertDispatchedWithoutChain($command, $callback = null) */ protected function assertDispatchedWithChainOfObjects($command, $expectedChain, $callback) { - $chain = collect($expectedChain)->map(function ($job) { - return serialize($job); - })->all(); + $chain = collect($expectedChain)->map(fn ($job) => serialize($job))->all(); PHPUnit::assertTrue( - $this->dispatched($command, $callback)->filter(function ($job) use ($chain) { - return $job->chained == $chain; - })->isNotEmpty(), + $this->dispatched($command, $callback)->filter( + fn ($job) => $job->chained == $chain + )->isNotEmpty(), 'The expected chain was not dispatched.' ); } @@ -374,12 +372,12 @@ protected function assertDispatchedWithChainOfObjects($command, $expectedChain, protected function assertDispatchedWithChainOfClasses($command, $expectedChain, $callback) { $matching = $this->dispatched($command, $callback)->map->chained->map(function ($chain) { - return collect($chain)->map(function ($job) { - return get_class(unserialize($job)); - }); - })->filter(function ($chain) use ($expectedChain) { - return $chain->all() === $expectedChain; - }); + return collect($chain)->map( + fn ($job) => get_class(unserialize($job)) + ); + })->filter( + fn ($chain) => $chain->all() === $expectedChain + ); PHPUnit::assertTrue( $matching->isNotEmpty(), 'The expected chain was not dispatched.' @@ -394,9 +392,7 @@ protected function assertDispatchedWithChainOfClasses($command, $expectedChain, */ protected function isChainOfObjects($chain) { - return ! collect($chain)->contains(function ($job) { - return ! is_object($job); - }); + return ! collect($chain)->contains(fn ($job) => ! is_object($job)); } /** @@ -413,6 +409,19 @@ public function assertBatched(callable $callback) ); } + /** + * Assert the number of batches that have been dispatched. + * + * @param int $count + * @return void + */ + public function assertBatchCount($count) + { + PHPUnit::assertCount( + $count, $this->batches, + ); + } + /** * Get all of the jobs matching a truth-test callback. * @@ -426,13 +435,9 @@ public function dispatched($command, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return collect($this->commands[$command])->filter(function ($command) use ($callback) { - return $callback($command); - }); + return collect($this->commands[$command])->filter(fn ($command) => $callback($command)); } /** @@ -448,13 +453,9 @@ public function dispatchedSync(string $command, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return collect($this->commandsSync[$command])->filter(function ($command) use ($callback) { - return $callback($command); - }); + return collect($this->commandsSync[$command])->filter(fn ($command) => $callback($command)); } /** @@ -470,13 +471,9 @@ public function dispatchedAfterResponse(string $command, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return collect($this->commandsAfterResponse[$command])->filter(function ($command) use ($callback) { - return $callback($command); - }); + return collect($this->commandsAfterResponse[$command])->filter(fn ($command) => $callback($command)); } /** @@ -491,9 +488,7 @@ public function batched(callable $callback) return collect(); } - return collect($this->batches)->filter(function ($batch) use ($callback) { - return $callback($batch); - }); + return collect($this->batches)->filter(fn ($batch) => $callback($batch)); } /** diff --git a/vendor/illuminate/support/Testing/Fakes/EventFake.php b/vendor/illuminate/support/Testing/Fakes/EventFake.php index ed5014f..97b11bb 100644 --- a/vendor/illuminate/support/Testing/Fakes/EventFake.php +++ b/vendor/illuminate/support/Testing/Fakes/EventFake.php @@ -5,6 +5,7 @@ use Closure; use Illuminate\Contracts\Events\Dispatcher; use Illuminate\Support\Arr; +use Illuminate\Support\Str; use Illuminate\Support\Traits\ReflectsClosures; use PHPUnit\Framework\Assert as PHPUnit; use ReflectionFunction; @@ -52,7 +53,7 @@ public function __construct(Dispatcher $dispatcher, $eventsToFake = []) * Assert if an event has a listener attached to it. * * @param string $expectedEvent - * @param string $expectedListener + * @param string|array $expectedListener * @return void */ public function assertListening($expectedEvent, $expectedListener) @@ -61,6 +62,18 @@ public function assertListening($expectedEvent, $expectedListener) $actualListener = (new ReflectionFunction($listenerClosure)) ->getStaticVariables()['listener']; + if (is_string($actualListener) && Str::contains($actualListener, '@')) { + $actualListener = Str::parseCallback($actualListener); + + if (is_string($expectedListener)) { + if (Str::contains($expectedListener, '@')) { + $expectedListener = Str::parseCallback($expectedListener); + } else { + $expectedListener = [$expectedListener, 'handle']; + } + } + } + if ($actualListener === $expectedListener || ($actualListener instanceof Closure && $expectedListener === Closure::class)) { @@ -167,13 +180,11 @@ public function dispatched($event, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return collect($this->events[$event])->filter(function ($arguments) use ($callback) { - return $callback(...$arguments); - }); + return collect($this->events[$event])->filter( + fn ($arguments) => $callback(...$arguments) + ); } /** diff --git a/vendor/illuminate/support/Testing/Fakes/MailFake.php b/vendor/illuminate/support/Testing/Fakes/MailFake.php index 103ffa7..c2d963d 100644 --- a/vendor/illuminate/support/Testing/Fakes/MailFake.php +++ b/vendor/illuminate/support/Testing/Fakes/MailFake.php @@ -128,9 +128,9 @@ public function assertNothingOutgoing() */ public function assertNothingSent() { - $mailableNames = collect($this->mailables)->map(function ($mailable) { - return get_class($mailable); - })->join(', '); + $mailableNames = collect($this->mailables)->map( + fn ($mailable) => get_class($mailable) + )->join(', '); PHPUnit::assertEmpty($this->mailables, 'The following mailables were sent unexpectedly: '.$mailableNames); } @@ -197,9 +197,9 @@ public function assertNotQueued($mailable, $callback = null) */ public function assertNothingQueued() { - $mailableNames = collect($this->queuedMailables)->map(function ($mailable) { - return get_class($mailable); - })->join(', '); + $mailableNames = collect($this->queuedMailables)->map( + fn ($mailable) => get_class($mailable) + )->join(', '); PHPUnit::assertEmpty($this->queuedMailables, 'The following mailables were queued unexpectedly: '.$mailableNames); } @@ -219,13 +219,9 @@ public function sent($mailable, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return $this->mailablesOf($mailable)->filter(function ($mailable) use ($callback) { - return $callback($mailable); - }); + return $this->mailablesOf($mailable)->filter(fn ($mailable) => $callback($mailable)); } /** @@ -254,13 +250,9 @@ public function queued($mailable, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return $this->queuedMailablesOf($mailable)->filter(function ($mailable) use ($callback) { - return $callback($mailable); - }); + return $this->queuedMailablesOf($mailable)->filter(fn ($mailable) => $callback($mailable)); } /** @@ -282,9 +274,7 @@ public function hasQueued($mailable) */ protected function mailablesOf($type) { - return collect($this->mailables)->filter(function ($mailable) use ($type) { - return $mailable instanceof $type; - }); + return collect($this->mailables)->filter(fn ($mailable) => $mailable instanceof $type); } /** @@ -295,9 +285,7 @@ protected function mailablesOf($type) */ protected function queuedMailablesOf($type) { - return collect($this->queuedMailables)->filter(function ($mailable) use ($type) { - return $mailable instanceof $type; - }); + return collect($this->queuedMailables)->filter(fn ($mailable) => $mailable instanceof $type); } /** @@ -363,12 +351,12 @@ public function send($view, array $data = [], $callback = null) $view->mailer($this->currentMailer); - $this->currentMailer = null; - if ($view instanceof ShouldQueue) { return $this->queue($view, $data); } + $this->currentMailer = null; + $this->mailables[] = $view; } @@ -430,4 +418,16 @@ protected function prepareMailableAndCallback($mailable, $callback) return [$mailable, $callback]; } + + /** + * Forget all of the resolved mailer instances. + * + * @return $this + */ + public function forgetMailers() + { + $this->currentMailer = null; + + return $this; + } } diff --git a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php index c7b12f4..3a36339 100644 --- a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php +++ b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php @@ -158,6 +158,34 @@ public function assertNothingSent() PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.'); } + /** + * Assert that no notifications were sent to the given notifiable. + * + * @param mixed $notifiable + * @return void + * + * @throws \Exception + */ + public function assertNothingSentTo($notifiable) + { + if (is_array($notifiable) || $notifiable instanceof Collection) { + if (count($notifiable) === 0) { + throw new Exception('No notifiable given.'); + } + + foreach ($notifiable as $singleNotifiable) { + $this->assertNothingSentTo($singleNotifiable); + } + + return; + } + + PHPUnit::assertEmpty( + $this->notifications[get_class($notifiable)][$notifiable->getKey()] ?? [], + 'Notifications were sent unexpectedly.', + ); + } + /** * Assert the total amount of times a notification was sent. * @@ -169,9 +197,7 @@ public function assertSentTimes($notification, $expectedCount) { $actualCount = collect($this->notifications) ->flatten(1) - ->reduce(function ($count, $sent) use ($notification) { - return $count + count($sent[$notification] ?? []); - }, 0); + ->reduce(fn ($count, $sent) => $count + count($sent[$notification] ?? []), 0); PHPUnit::assertSame( $expectedCount, $actualCount, @@ -179,6 +205,22 @@ public function assertSentTimes($notification, $expectedCount) ); } + /** + * Assert the total count of notification that were sent. + * + * @param int $expectedCount + * @return void + */ + public function assertCount($expectedCount) + { + $actualCount = collect($this->notifications)->flatten(3)->count(); + + PHPUnit::assertSame( + $expectedCount, $actualCount, + "Expected {$expectedCount} notifications to be sent, but {$actualCount} were sent." + ); + } + /** * Assert the total amount of times a notification was sent. * @@ -207,15 +249,13 @@ public function sent($notifiable, $notification, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; $notifications = collect($this->notificationsFor($notifiable, $notification)); - return $notifications->filter(function ($arguments) use ($callback) { - return $callback(...array_values($arguments)); - })->pluck('notification'); + return $notifications->filter( + fn ($arguments) => $callback(...array_values($arguments)) + )->pluck('notification'); } /** @@ -278,9 +318,7 @@ public function sendNow($notifiables, $notification, array $channels = null) if (method_exists($notification, 'shouldSend')) { $notifiableChannels = array_filter( $notifiableChannels, - function ($channel) use ($notification, $notifiable) { - return $notification->shouldSend($notifiable, $channel) !== false; - } + fn ($channel) => $notification->shouldSend($notifiable, $channel) !== false ); if (empty($notifiableChannels)) { diff --git a/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/vendor/illuminate/support/Testing/Fakes/QueueFake.php index 64d6414..65e906b 100644 --- a/vendor/illuminate/support/Testing/Fakes/QueueFake.php +++ b/vendor/illuminate/support/Testing/Fakes/QueueFake.php @@ -6,6 +6,7 @@ use Closure; use Illuminate\Contracts\Queue\Queue; use Illuminate\Queue\QueueManager; +use Illuminate\Support\Collection; use Illuminate\Support\Traits\ReflectsClosures; use PHPUnit\Framework\Assert as PHPUnit; @@ -13,6 +14,20 @@ class QueueFake extends QueueManager implements Queue { use ReflectsClosures; + /** + * The original queue manager. + * + * @var \Illuminate\Contracts\Queue\Queue + */ + protected $queue; + + /** + * The job types that should be intercepted instead of pushed to the queue. + * + * @var array + */ + protected $jobsToFake; + /** * All of the jobs that have been pushed. * @@ -20,6 +35,22 @@ class QueueFake extends QueueManager implements Queue */ protected $jobs = []; + /** + * Create a new fake queue instance. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @param array $jobsToFake + * @param \Illuminate\Queue\QueueManager|null $queue + * @return void + */ + public function __construct($app, $jobsToFake = [], $queue = null) + { + parent::__construct($app); + + $this->jobsToFake = Collection::wrap($jobsToFake); + $this->queue = $queue; + } + /** * Assert if a job was pushed based on a truth-test callback. * @@ -135,14 +166,10 @@ public function assertPushedWithoutChain($job, $callback = null) */ protected function assertPushedWithChainOfObjects($job, $expectedChain, $callback) { - $chain = collect($expectedChain)->map(function ($job) { - return serialize($job); - })->all(); + $chain = collect($expectedChain)->map(fn ($job) => serialize($job))->all(); PHPUnit::assertTrue( - $this->pushed($job, $callback)->filter(function ($job) use ($chain) { - return $job->chained == $chain; - })->isNotEmpty(), + $this->pushed($job, $callback)->filter(fn ($job) => $job->chained == $chain)->isNotEmpty(), 'The expected chain was not pushed.' ); } @@ -178,9 +205,7 @@ protected function assertPushedWithChainOfClasses($job, $expectedChain, $callbac */ protected function isChainOfObjects($chain) { - return ! collect($chain)->contains(function ($job) { - return ! is_object($job); - }); + return ! collect($chain)->contains(fn ($job) => ! is_object($job)); } /** @@ -225,13 +250,11 @@ public function pushed($job, $callback = null) return collect(); } - $callback = $callback ?: function () { - return true; - }; + $callback = $callback ?: fn () => true; - return collect($this->jobs[$job])->filter(function ($data) use ($callback) { - return $callback($data['job'], $data['queue']); - })->pluck('job'); + return collect($this->jobs[$job])->filter( + fn ($data) => $callback($data['job'], $data['queue'], $data['data']) + )->pluck('job'); } /** @@ -264,25 +287,49 @@ public function connection($value = null) */ public function size($queue = null) { - return collect($this->jobs)->flatten(1)->filter(function ($job) use ($queue) { - return $job['queue'] === $queue; - })->count(); + return collect($this->jobs)->flatten(1)->filter( + fn ($job) => $job['queue'] === $queue + )->count(); } /** * Push a new job onto the queue. * - * @param string $job + * @param string|object $job * @param mixed $data * @param string|null $queue * @return mixed */ public function push($job, $data = '', $queue = null) { - $this->jobs[is_object($job) ? get_class($job) : $job][] = [ - 'job' => $job, - 'queue' => $queue, - ]; + if ($this->shouldFakeJob($job)) { + $this->jobs[is_object($job) ? get_class($job) : $job][] = [ + 'job' => $job, + 'queue' => $queue, + 'data' => $data, + ]; + } else { + is_object($job) && isset($job->connection) + ? $this->queue->connection($job->connection)->push($job, $data, $queue) + : $this->queue->push($job, $data, $queue); + } + } + + /** + * Determine if a job should be faked or actually dispatched. + * + * @param object $job + * @return bool + */ + public function shouldFakeJob($job) + { + if ($this->jobsToFake->isEmpty()) { + return true; + } + + return $this->jobsToFake->contains( + fn ($jobToFake) => $job instanceof ((string) $jobToFake) + ); } /** @@ -299,10 +346,10 @@ public function pushRaw($payload, $queue = null, array $options = []) } /** - * Push a new job onto the queue after a delay. + * Push a new job onto the queue after (n) seconds. * * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job + * @param string|object $job * @param mixed $data * @param string|null $queue * @return mixed @@ -316,7 +363,7 @@ public function later($delay, $job, $data = '', $queue = null) * Push a new job onto the queue. * * @param string $queue - * @param string $job + * @param string|object $job * @param mixed $data * @return mixed */ @@ -326,11 +373,11 @@ public function pushOn($queue, $job, $data = '') } /** - * Push a new job onto the queue after a delay. + * Push a new job onto a specific queue after (n) seconds. * * @param string $queue * @param \DateTimeInterface|\DateInterval|int $delay - * @param string $job + * @param string|object $job * @param mixed $data * @return mixed */ diff --git a/vendor/illuminate/support/Traits/Conditionable.php b/vendor/illuminate/support/Traits/Conditionable.php deleted file mode 100644 index 7980827..0000000 --- a/vendor/illuminate/support/Traits/Conditionable.php +++ /dev/null @@ -1,44 +0,0 @@ -input = $input; } + /** + * Determine if the validated input has one or more keys. + * + * @param mixed $keys + * @return bool + */ + public function has($keys) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + foreach ($keys as $key) { + if (! Arr::has($this->input, $key)) { + return false; + } + } + + return true; + } + + /** + * Determine if the validated input is missing one or more keys. + * + * @param mixed $keys + * @return bool + */ + public function missing($keys) + { + return ! $this->has($keys); + } + /** * Get a subset containing the provided keys with values from the input data. * - * @param array|mixed $keys + * @param mixed $keys * @return array */ public function only($keys) @@ -54,7 +85,7 @@ public function only($keys) /** * Get all of the input except for a specified array of items. * - * @param array|mixed $keys + * @param mixed $keys * @return array */ public function except($keys) @@ -159,8 +190,7 @@ public function __unset($name) * @param mixed $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return isset($this->input[$key]); } @@ -171,8 +201,7 @@ public function offsetExists($key) * @param mixed $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->input[$key]; } @@ -184,8 +213,7 @@ public function offsetGet($key) * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { if (is_null($key)) { $this->input[] = $value; @@ -200,8 +228,7 @@ public function offsetSet($key, $value) * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->input[$key]); } @@ -211,8 +238,7 @@ public function offsetUnset($key) * * @return \ArrayIterator */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->input); } diff --git a/vendor/illuminate/support/ViewErrorBag.php b/vendor/illuminate/support/ViewErrorBag.php index d51bb53..ff9da4f 100644 --- a/vendor/illuminate/support/ViewErrorBag.php +++ b/vendor/illuminate/support/ViewErrorBag.php @@ -78,8 +78,7 @@ public function any() * * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return $this->getBag('default')->count(); } diff --git a/vendor/illuminate/support/composer.json b/vendor/illuminate/support/composer.json index 999fba9..1e1681c 100644 --- a/vendor/illuminate/support/composer.json +++ b/vendor/illuminate/support/composer.json @@ -14,15 +14,16 @@ } ], "require": { - "php": "^7.3|^8.0", + "php": "^8.0.2", "ext-json": "*", "ext-mbstring": "*", - "doctrine/inflector": "^1.4|^2.0", - "illuminate/collections": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/macroable": "^8.0", + "doctrine/inflector": "^2.0", + "illuminate/collections": "^9.0", + "illuminate/conditionable": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/macroable": "^9.0", "nesbot/carbon": "^2.53.1", - "voku/portable-ascii": "^1.4.8" + "voku/portable-ascii": "^2.0" }, "conflict": { "tightenco/collect": "<5.5.33" @@ -37,16 +38,16 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "suggest": { - "illuminate/filesystem": "Required to use the composer class (^8.0).", - "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "illuminate/filesystem": "Required to use the composer class (^9.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).", "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", - "symfony/process": "Required to use the composer class (^5.4).", - "symfony/var-dumper": "Required to use the dd function (^5.4).", - "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + "symfony/process": "Required to use the composer class (^6.0).", + "symfony/var-dumper": "Required to use the dd function (^6.0).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." }, "config": { "sort-packages": true diff --git a/vendor/illuminate/support/helpers.php b/vendor/illuminate/support/helpers.php index 0b82fe7..65d69c9 100644 --- a/vendor/illuminate/support/helpers.php +++ b/vendor/illuminate/support/helpers.php @@ -6,6 +6,7 @@ use Illuminate\Support\Env; use Illuminate\Support\HigherOrderTapProxy; use Illuminate\Support\Optional; +use Illuminate\Support\Str; if (! function_exists('append_config')) { /** @@ -203,7 +204,7 @@ function optional($value = null, callable $callback = null) function preg_replace_array($pattern, array $replacements, $subject) { return preg_replace_callback($pattern, function () use (&$replacements) { - foreach ($replacements as $key => $value) { + foreach ($replacements as $value) { return array_shift($replacements); } }, $subject); @@ -214,7 +215,7 @@ function preg_replace_array($pattern, array $replacements, $subject) /** * Retry an operation a given number of times. * - * @param int $times + * @param int|array $times * @param callable $callback * @param int|\Closure $sleepMilliseconds * @param callable|null $when @@ -226,6 +227,14 @@ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) { $attempts = 0; + $backoff = []; + + if (is_array($times)) { + $backoff = $times; + + $times = count($times) + 1; + } + beginning: $attempts++; $times--; @@ -237,8 +246,10 @@ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) throw $e; } + $sleepMilliseconds = $backoff[$attempts - 1] ?? $sleepMilliseconds; + if ($sleepMilliseconds) { - usleep(value($sleepMilliseconds, $attempts) * 1000); + usleep(value($sleepMilliseconds, $attempts, $e) * 1000); } goto beginning; @@ -246,6 +257,34 @@ function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) } } +if (! function_exists('str')) { + /** + * Get a new stringable object from the given string. + * + * @param string|null $string + * @return \Illuminate\Support\Stringable|mixed + */ + function str($string = null) + { + if (func_num_args() === 0) { + return new class + { + public function __call($method, $parameters) + { + return Str::$method(...$parameters); + } + + public function __toString() + { + return ''; + } + }; + } + + return Str::of($string); + } +} + if (! function_exists('tap')) { /** * Call the given Closure with the given value then return the value. @@ -368,9 +407,11 @@ function windows_os() /** * Return the given value, optionally passed through the given callback. * - * @param mixed $value - * @param callable|null $callback - * @return mixed + * @template TValue + * + * @param TValue $value + * @param (callable(TValue): TValue)|null $callback + * @return TValue */ function with($value, callable $callback = null) { diff --git a/vendor/illuminate/view/AnonymousComponent.php b/vendor/illuminate/view/AnonymousComponent.php index 2fb21e1..eba6436 100644 --- a/vendor/illuminate/view/AnonymousComponent.php +++ b/vendor/illuminate/view/AnonymousComponent.php @@ -51,7 +51,7 @@ public function data() $this->attributes = $this->attributes ?: $this->newAttributeBag(); return array_merge( - optional($this->data['attributes'] ?? null)->getAttributes() ?: [], + ($this->data['attributes'] ?? null)?->getAttributes() ?: [], $this->attributes->getAttributes(), $this->data, ['attributes' => $this->attributes] diff --git a/vendor/illuminate/view/Compilers/BladeCompiler.php b/vendor/illuminate/view/Compilers/BladeCompiler.php index 5475143..93ddea7 100644 --- a/vendor/illuminate/view/Compilers/BladeCompiler.php +++ b/vendor/illuminate/view/Compilers/BladeCompiler.php @@ -2,9 +2,14 @@ namespace Illuminate\View\Compilers; +use Illuminate\Container\Container; +use Illuminate\Contracts\Support\Htmlable; +use Illuminate\Contracts\View\Factory as ViewFactory; +use Illuminate\Contracts\View\View; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Illuminate\Support\Traits\ReflectsClosures; +use Illuminate\View\Component; use InvalidArgumentException; class BladeCompiler extends Compiler implements CompilerInterface @@ -111,12 +116,19 @@ class BladeCompiler extends Compiler implements CompilerInterface protected $footer = []; /** - * Array to temporary store the raw blocks found in the template. + * Array to temporarily store the raw blocks found in the template. * * @var array */ protected $rawBlocks = []; + /** + * The array of anonymous component namespaces to autoload from. + * + * @var array + */ + protected $anonymousComponentNamespaces = []; + /** * The array of class component aliases and their class names. * @@ -236,7 +248,7 @@ public function compileString($value) ); foreach ($this->precompilers as $precompiler) { - $value = call_user_func($precompiler, $value); + $value = $precompiler($value); } // Here we will loop through all of the tokens returned by the Zend lexer and @@ -267,6 +279,66 @@ public function compileString($value) $result); } + /** + * Evaluate and render a Blade string to HTML. + * + * @param string $string + * @param array $data + * @param bool $deleteCachedView + * @return string + */ + public static function render($string, $data = [], $deleteCachedView = false) + { + $component = new class($string) extends Component + { + protected $template; + + public function __construct($template) + { + $this->template = $template; + } + + public function render() + { + return $this->template; + } + }; + + $view = Container::getInstance() + ->make(ViewFactory::class) + ->make($component->resolveView(), $data); + + return tap($view->render(), function () use ($view, $deleteCachedView) { + if ($deleteCachedView) { + unlink($view->getPath()); + } + }); + } + + /** + * Render a component instance to HTML. + * + * @param \Illuminate\View\Component $component + * @return string + */ + public static function renderComponent(Component $component) + { + $data = $component->data(); + + $view = value($component->resolveView(), $data); + + if ($view instanceof View) { + return $view->with($data)->render(); + } elseif ($view instanceof Htmlable) { + return $view->toHtml(); + } else { + return Container::getInstance() + ->make(ViewFactory::class) + ->make($view, $data) + ->render(); + } + } + /** * Store the blocks that do not receive compilation. * @@ -275,11 +347,11 @@ public function compileString($value) */ protected function storeUncompiledBlocks($value) { - if (strpos($value, '@verbatim') !== false) { + if (str_contains($value, '@verbatim')) { $value = $this->storeVerbatimBlocks($value); } - if (strpos($value, '@php') !== false) { + if (str_contains($value, '@php')) { $value = $this->storePhpBlocks($value); } @@ -360,7 +432,7 @@ protected function restoreRawContent($result) } /** - * Get a placeholder to temporary mark the position of raw blocks. + * Get a placeholder to temporarily mark the position of raw blocks. * * @param int|string $replace * @return string @@ -439,7 +511,7 @@ protected function compileStatements($value) */ protected function compileStatement($match) { - if (Str::contains($match[1], '@')) { + if (str_contains($match[1], '@')) { $match[0] = isset($match[3]) ? $match[1].$match[3] : $match[1]; } elseif (isset($this->customDirectives[$match[1]])) { $match[0] = $this->callCustomDirective($match[1], Arr::get($match, 3)); @@ -459,9 +531,9 @@ protected function compileStatement($match) */ protected function callCustomDirective($name, $value) { - $value = $value ?? ''; + $value ??= ''; - if (Str::startsWith($value, '(') && Str::endsWith($value, ')')) { + if (str_starts_with($value, '(') && str_ends_with($value, ')')) { $value = Str::substr($value, 1, -1); } @@ -560,12 +632,12 @@ public function check($name, ...$parameters) */ public function component($class, $alias = null, $prefix = '') { - if (! is_null($alias) && Str::contains($alias, '\\')) { + if (! is_null($alias) && str_contains($alias, '\\')) { [$class, $alias] = [$alias, $class]; } if (is_null($alias)) { - $alias = Str::contains($class, '\\View\\Components\\') + $alias = str_contains($class, '\\View\\Components\\') ? collect(explode('\\', Str::after($class, '\\View\\Components\\')))->map(function ($segment) { return Str::kebab($segment); })->implode(':') @@ -607,6 +679,23 @@ public function getClassComponentAliases() return $this->classComponentAliases; } + /** + * Register an anonymous component namespace. + * + * @param string $directory + * @param string|null $prefix + * @return void + */ + public function anonymousComponentNamespace(string $directory, string $prefix = null) + { + $prefix ??= $directory; + + $this->anonymousComponentNamespaces[$prefix] = Str::of($directory) + ->replace('/', '.') + ->trim('. ') + ->toString(); + } + /** * Register a class-based component namespace. * @@ -619,6 +708,16 @@ public function componentNamespace($namespace, $prefix) $this->classComponentNamespaces[$prefix] = $namespace; } + /** + * Get the registered anonymous component namespaces. + * + * @return array + */ + public function getAnonymousComponentNamespaces() + { + return $this->anonymousComponentNamespaces; + } + /** * Get the registered class component namespaces. * diff --git a/vendor/illuminate/view/Compilers/Compiler.php b/vendor/illuminate/view/Compilers/Compiler.php index e14c852..90c5d60 100644 --- a/vendor/illuminate/view/Compilers/Compiler.php +++ b/vendor/illuminate/view/Compilers/Compiler.php @@ -3,34 +3,64 @@ namespace Illuminate\View\Compilers; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Str; use InvalidArgumentException; abstract class Compiler { /** - * The Filesystem instance. + * The filesystem instance. * * @var \Illuminate\Filesystem\Filesystem */ protected $files; /** - * Get the cache path for the compiled views. + * The cache path for the compiled views. * * @var string */ protected $cachePath; + /** + * The base path that should be removed from paths before hashing. + * + * @var string + */ + protected $basePath; + + /** + * Determines if compiled views should be cached. + * + * @var bool + */ + protected $shouldCache; + + /** + * The compiled view file extension. + * + * @var string + */ + protected $compiledExtension = 'php'; + /** * Create a new compiler instance. * * @param \Illuminate\Filesystem\Filesystem $files * @param string $cachePath + * @param string $basePath + * @param bool $shouldCache + * @param string $compiledExtension * @return void * * @throws \InvalidArgumentException */ - public function __construct(Filesystem $files, $cachePath) + public function __construct( + Filesystem $files, + $cachePath, + $basePath = '', + $shouldCache = true, + $compiledExtension = 'php') { if (! $cachePath) { throw new InvalidArgumentException('Please provide a valid cache path.'); @@ -38,6 +68,9 @@ public function __construct(Filesystem $files, $cachePath) $this->files = $files; $this->cachePath = $cachePath; + $this->basePath = $basePath; + $this->shouldCache = $shouldCache; + $this->compiledExtension = $compiledExtension; } /** @@ -48,7 +81,7 @@ public function __construct(Filesystem $files, $cachePath) */ public function getCompiledPath($path) { - return $this->cachePath.'/'.sha1('v2'.$path).'.php'; + return $this->cachePath.'/'.sha1('v2'.Str::after($path, $this->basePath)).'.'.$this->compiledExtension; } /** @@ -59,6 +92,10 @@ public function getCompiledPath($path) */ public function isExpired($path) { + if (! $this->shouldCache) { + return true; + } + $compiled = $this->getCompiledPath($path); // If the compiled file doesn't exist we will indicate that the view is expired diff --git a/vendor/illuminate/view/Compilers/ComponentTagCompiler.php b/vendor/illuminate/view/Compilers/ComponentTagCompiler.php index 469bd78..1247cd2 100644 --- a/vendor/illuminate/view/Compilers/ComponentTagCompiler.php +++ b/vendor/illuminate/view/Compilers/ComponentTagCompiler.php @@ -216,7 +216,7 @@ protected function componentString(string $component, array $attributes) return [Str::camel($key) => $value]; }); - // If the component doesn't exists as a class we'll assume it's a class-less + // If the component doesn't exist as a class, we'll assume it's a class-less // component and pass the component as a view parameter to the data so it // can be accessed within the component and we can render out the view. if (! class_exists($class)) { @@ -231,6 +231,9 @@ protected function componentString(string $component, array $attributes) } return "##BEGIN-COMPONENT-CLASS##@component('{$class}', '{$component}', [".$this->attributesToString($parameters, $escapeBound = false).']) +getConstructor()): ?> +except(collect($constructor->getParameters())->map->getName()->all()); ?> + withAttributes(['.$this->attributesToString($attributes->all(), $escapeAttributes = $class !== DynamicComponent::class).']); ?>'; } @@ -268,12 +271,29 @@ public function componentClass(string $component) return $class; } - if ($viewFactory->exists($view = $this->guessViewName($component))) { - return $view; - } - - if ($viewFactory->exists($view = $this->guessViewName($component).'.index')) { - return $view; + $guess = collect($this->blade->getAnonymousComponentNamespaces()) + ->filter(function ($directory, $prefix) use ($component) { + return Str::startsWith($component, $prefix.'::'); + }) + ->prepend('components', $component) + ->reduce(function ($carry, $directory, $prefix) use ($component, $viewFactory) { + if (! is_null($carry)) { + return $carry; + } + + $componentName = Str::after($component, $prefix.'::'); + + if ($viewFactory->exists($view = $this->guessViewName($componentName, $directory))) { + return $view; + } + + if ($viewFactory->exists($view = $this->guessViewName($componentName, $directory).'.index')) { + return $view; + } + }); + + if (! is_null($guess)) { + return $guess; } throw new InvalidArgumentException( @@ -293,7 +313,7 @@ public function findClassByComponent(string $component) $prefix = $segments[0]; - if (! isset($this->namespaces[$prefix]) || ! isset($segments[1])) { + if (! isset($this->namespaces[$prefix], $segments[1])) { return; } @@ -338,15 +358,18 @@ public function formatClassName(string $component) * Guess the view name for the given component. * * @param string $name + * @param string $prefix * @return string */ - public function guessViewName($name) + public function guessViewName($name, $prefix = 'components.') { - $prefix = 'components.'; + if (! Str::endsWith($prefix, '.')) { + $prefix .= '.'; + } $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; - if (Str::contains($name, $delimiter)) { + if (str_contains($name, $delimiter)) { return Str::replaceFirst($delimiter, $delimiter.$prefix, $name); } @@ -362,7 +385,7 @@ public function guessViewName($name) */ public function partitionDataAndAttributes($class, array $attributes) { - // If the class doesn't exists, we'll assume it's a class-less component and + // If the class doesn't exist, we'll assume it is a class-less component and // return all of the attributes as both data and attributes since we have // now way to partition them. The user can exclude attributes manually. if (! class_exists($class)) { @@ -403,8 +426,8 @@ public function compileSlots(string $value) < \s* x[\-\:]slot - \s+ - (:?)name=(?(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)) + (?:\:(?\w+(?:-\w+)*))? + (?:\s+(:?)name=(?(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)))? (? (?: \s+ @@ -435,9 +458,13 @@ public function compileSlots(string $value) /x"; $value = preg_replace_callback($pattern, function ($matches) { - $name = $this->stripQuotes($matches['name']); + $name = $this->stripQuotes($matches['inlineName'] ?: $matches['name']); + + if (Str::contains($name, '-')) { + $name = Str::camel($name); + } - if ($matches[1] !== ':') { + if ($matches[2] !== ':') { $name = "'{$name}'"; } @@ -495,7 +522,7 @@ protected function getAttributesFromAttributeString(string $attributeString) $value = $this->stripQuotes($value); - if (Str::startsWith($attribute, 'bind:')) { + if (str_starts_with($attribute, 'bind:')) { $attribute = Str::after($attribute, 'bind:'); $this->boundAttributes[$attribute] = true; @@ -503,7 +530,7 @@ protected function getAttributesFromAttributeString(string $attributeString) $value = "'".$this->compileAttributeEchos($value)."'"; } - if (Str::startsWith($attribute, '::')) { + if (str_starts_with($attribute, '::')) { $attribute = substr($attribute, 1); } diff --git a/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php b/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php index db4f0e8..0fe45be 100644 --- a/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php +++ b/vendor/illuminate/view/Compilers/Concerns/CompilesComponents.php @@ -23,7 +23,7 @@ trait CompilesComponents */ protected function compileComponent($expression) { - [$component, $alias, $data] = strpos($expression, ',') !== false + [$component, $alias, $data] = str_contains($expression, ',') ? array_map('trim', explode(',', trim($expression, '()'), 3)) + ['', '', ''] : [trim($expression, '()'), '', '']; @@ -64,7 +64,7 @@ public static function compileClassComponentOpening(string $component, string $a { return implode("\n", [ '', - 'getContainer()->make('.Str::finish($component, '::class').', '.($data ?: '[]').'); ?>', + 'getContainer()->make('.Str::finish($component, '::class').', '.($data ?: '[]').' + (isset($attributes) ? (array) $attributes->getIterator() : [])); ?>', 'withName('.$alias.'); ?>', 'shouldRender()): ?>', 'startComponent($component->resolveView(), $component->data()); ?>', @@ -149,7 +149,10 @@ protected function compileEndComponentFirst() */ protected function compileProps($expression) { - return "exceptProps{$expression}; ?> + return "onlyProps{$expression} as \$__key => \$__value) { + \$\$__key = \$\$__key ?? \$__value; +} ?> +exceptProps{$expression}; ?> \$__value) { \$\$__key = \$\$__key ?? \$__value; } ?> @@ -182,7 +185,7 @@ protected function compileAware($expression) */ public static function sanitizeComponentAttribute($value) { - if (is_object($value) && $value instanceof CanBeEscapedWhenCastToString) { + if ($value instanceof CanBeEscapedWhenCastToString) { return $value->escapeWhenCastingToString(); } diff --git a/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php b/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php index 6bae1e1..8f6c4ce 100644 --- a/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php +++ b/vendor/illuminate/view/Compilers/Concerns/CompilesConditionals.php @@ -304,4 +304,71 @@ public function compileEndOnce() { return ''; } + + /** + * Compile a selected block into valid PHP. + * + * @param string $condition + * @return string + */ + protected function compileSelected($condition) + { + return ""; + } + + /** + * Compile a checked block into valid PHP. + * + * @param string $condition + * @return string + */ + protected function compileChecked($condition) + { + return ""; + } + + /** + * Compile a disabled block into valid PHP. + * + * @param string $condition + * @return string + */ + protected function compileDisabled($condition) + { + return ""; + } + + /** + * Compile a readonly block into valid PHP. + * + * @param string $condition + * @return string + */ + protected function compileReadonly($condition) + { + return ""; + } + + /** + * Compile the push statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compilePushIf($expression) + { + $parts = explode(',', $this->stripParentheses($expression), 2); + + return "startPush({$parts[1]}); ?>"; + } + + /** + * Compile the end-push statements into valid PHP. + * + * @return string + */ + protected function compileEndPushIf() + { + return 'stopPush(); endif; ?>'; + } } diff --git a/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php b/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php index 5924a0a..37f1cbc 100644 --- a/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php +++ b/vendor/illuminate/view/Compilers/Concerns/CompilesEchos.php @@ -143,7 +143,7 @@ protected function wrapInEchoHandler($value) { $value = Str::of($value) ->trim() - ->when(Str::endsWith($value, ';'), function ($str) { + ->when(str_ends_with($value, ';'), function ($str) { return $str->beforeLast(';'); }); diff --git a/vendor/illuminate/view/Compilers/Concerns/CompilesIncludes.php b/vendor/illuminate/view/Compilers/Concerns/CompilesIncludes.php index b80a5b5..aa3d4a6 100644 --- a/vendor/illuminate/view/Compilers/Concerns/CompilesIncludes.php +++ b/vendor/illuminate/view/Compilers/Concerns/CompilesIncludes.php @@ -64,7 +64,7 @@ protected function compileIncludeUnless($expression) { $expression = $this->stripParentheses($expression); - return "renderWhen(! $expression, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>"; + return "renderUnless($expression, \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?>"; } /** diff --git a/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php b/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php index 79a380e..16ceef3 100644 --- a/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php +++ b/vendor/illuminate/view/Compilers/Concerns/CompilesStacks.php @@ -2,6 +2,8 @@ namespace Illuminate\View\Compilers\Concerns; +use Illuminate\Support\Str; + trait CompilesStacks { /** @@ -26,6 +28,24 @@ protected function compilePush($expression) return "startPush{$expression}; ?>"; } + /** + * Compile the push-once statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compilePushOnce($expression) + { + $parts = explode(',', $this->stripParentheses($expression), 2); + + [$stack, $id] = [$parts[0], $parts[1] ?? '']; + + $id = trim($id) ?: "'".(string) Str::uuid()."'"; + + return 'hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); +$__env->startPush('.$stack.'); ?>'; + } + /** * Compile the end-push statements into valid PHP. * @@ -36,6 +56,16 @@ protected function compileEndpush() return 'stopPush(); ?>'; } + /** + * Compile the end-push-once statements into valid PHP. + * + * @return string + */ + protected function compileEndpushOnce() + { + return 'stopPush(); endif; ?>'; + } + /** * Compile the prepend statements into valid PHP. * @@ -47,6 +77,24 @@ protected function compilePrepend($expression) return "startPrepend{$expression}; ?>"; } + /** + * Compile the prepend-once statements into valid PHP. + * + * @param string $expression + * @return string + */ + protected function compilePrependOnce($expression) + { + $parts = explode(',', $this->stripParentheses($expression), 2); + + [$stack, $id] = [$parts[0], $parts[1] ?? '']; + + $id = trim($id) ?: "'".(string) Str::uuid()."'"; + + return 'hasRenderedOnce('.$id.')): $__env->markAsRenderedOnce('.$id.'); +$__env->startPrepend('.$stack.'); ?>'; + } + /** * Compile the end-prepend statements into valid PHP. * @@ -56,4 +104,14 @@ protected function compileEndprepend() { return 'stopPrepend(); ?>'; } + + /** + * Compile the end-prepend-once statements into valid PHP. + * + * @return string + */ + protected function compileEndprependOnce() + { + return 'stopPrepend(); endif; ?>'; + } } diff --git a/vendor/illuminate/view/Component.php b/vendor/illuminate/view/Component.php index 402a13a..0acee35 100644 --- a/vendor/illuminate/view/Component.php +++ b/vendor/illuminate/view/Component.php @@ -6,7 +6,6 @@ use Illuminate\Container\Container; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\View\View as ViewContract; -use Illuminate\Support\Str; use ReflectionClass; use ReflectionMethod; use ReflectionProperty; @@ -75,7 +74,7 @@ public function resolveView() $resolver = function ($view) { $factory = Container::getInstance()->make('view'); - return $factory->exists($view) + return strlen($view) <= PHP_MAXPATHLEN && $factory->exists($view) ? $view : $this->createBladeViewFromString($factory, $view); }; @@ -223,7 +222,7 @@ protected function createInvokableVariable(string $method) */ protected function shouldIgnore($name) { - return Str::startsWith($name, '__') || + return str_starts_with($name, '__') || in_array($name, $this->ignoredMethods()); } diff --git a/vendor/illuminate/view/ComponentAttributeBag.php b/vendor/illuminate/view/ComponentAttributeBag.php index 255d164..1be7382 100644 --- a/vendor/illuminate/view/ComponentAttributeBag.php +++ b/vendor/illuminate/view/ComponentAttributeBag.php @@ -11,6 +11,7 @@ use Illuminate\Support\Traits\Conditionable; use Illuminate\Support\Traits\Macroable; use IteratorAggregate; +use Traversable; class ComponentAttributeBag implements ArrayAccess, Htmlable, IteratorAggregate { @@ -154,6 +155,17 @@ public function thatStartWith($needles) return $this->whereStartsWith($needles); } + /** + * Only include the given attribute from the attribute array. + * + * @param mixed|array $keys + * @return static + */ + public function onlyProps($keys) + { + return $this->only($this->extractPropNames($keys)); + } + /** * Exclude the given attribute from the attribute array. * @@ -161,6 +173,17 @@ public function thatStartWith($needles) * @return static */ public function exceptProps($keys) + { + return $this->except($this->extractPropNames($keys)); + } + + /** + * Extract prop names from given keys. + * + * @param mixed|array $keys + * @return array + */ + protected function extractPropNames($keys) { $props = []; @@ -171,7 +194,7 @@ public function exceptProps($keys) $props[] = Str::kebab($key); } - return $this->except($props); + return $props; } /** @@ -323,8 +346,7 @@ public function __invoke(array $attributeDefaults = []) * @param string $offset * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return isset($this->attributes[$offset]); } @@ -335,8 +357,7 @@ public function offsetExists($offset) * @param string $offset * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->get($offset); } @@ -348,8 +369,7 @@ public function offsetGet($offset) * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->attributes[$offset] = $value; } @@ -360,8 +380,7 @@ public function offsetSet($offset, $value) * @param string $offset * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { unset($this->attributes[$offset]); } @@ -371,8 +390,7 @@ public function offsetUnset($offset) * * @return \ArrayIterator */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->attributes); } diff --git a/vendor/illuminate/view/Concerns/ManagesEvents.php b/vendor/illuminate/view/Concerns/ManagesEvents.php index 3990290..d6cd9d8 100644 --- a/vendor/illuminate/view/Concerns/ManagesEvents.php +++ b/vendor/illuminate/view/Concerns/ManagesEvents.php @@ -55,7 +55,7 @@ public function composer($views, $callback) $composers = []; foreach ((array) $views as $view) { - $composers[] = $this->addViewEvent($view, $callback, 'composing: '); + $composers[] = $this->addViewEvent($view, $callback); } return $composers; @@ -145,7 +145,7 @@ protected function parseClassEvent($class, $prefix) */ protected function classEventMethodForPrefix($prefix) { - return Str::contains($prefix, 'composing') ? 'compose' : 'create'; + return str_contains($prefix, 'composing') ? 'compose' : 'create'; } /** @@ -157,7 +157,7 @@ protected function classEventMethodForPrefix($prefix) */ protected function addEventListener($name, $callback) { - if (Str::contains($name, '*')) { + if (str_contains($name, '*')) { $callback = function ($name, array $data) use ($callback) { return $callback($data[0]); }; diff --git a/vendor/illuminate/view/Concerns/ManagesLoops.php b/vendor/illuminate/view/Concerns/ManagesLoops.php index edd6363..95f06c8 100644 --- a/vendor/illuminate/view/Concerns/ManagesLoops.php +++ b/vendor/illuminate/view/Concerns/ManagesLoops.php @@ -2,8 +2,8 @@ namespace Illuminate\View\Concerns; -use Countable; use Illuminate\Support\Arr; +use Illuminate\Support\LazyCollection; trait ManagesLoops { @@ -22,7 +22,9 @@ trait ManagesLoops */ public function addLoop($data) { - $length = is_array($data) || $data instanceof Countable ? count($data) : null; + $length = is_countable($data) && ! $data instanceof LazyCollection + ? count($data) + : null; $parent = Arr::last($this->loopsStack); diff --git a/vendor/illuminate/view/Factory.php b/vendor/illuminate/view/Factory.php index eda479d..1bcac2f 100644 --- a/vendor/illuminate/view/Factory.php +++ b/vendor/illuminate/view/Factory.php @@ -7,7 +7,6 @@ use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\View\Factory as FactoryContract; use Illuminate\Support\Arr; -use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use Illuminate\View\Engines\EngineResolver; use InvalidArgumentException; @@ -189,6 +188,20 @@ public function renderWhen($condition, $view, $data = [], $mergeData = []) return $this->make($view, $this->parseData($data), $mergeData)->render(); } + /** + * Get the rendered content of the view based on the negation of a given condition. + * + * @param bool $condition + * @param string $view + * @param \Illuminate\Contracts\Support\Arrayable|array $data + * @param array $mergeData + * @return string + */ + public function renderUnless($condition, $view, $data = [], $mergeData = []) + { + return $this->renderWhen(! $condition, $view, $data, $mergeData); + } + /** * Get the rendered contents of a partial from a loop. * @@ -217,7 +230,7 @@ public function renderEach($view, $data, $iterator, $empty = 'raw|') // view. Alternatively, the "empty view" could be a raw string that begins // with "raw|" for convenience and to let this know that it is a string. else { - $result = Str::startsWith($empty, 'raw|') + $result = str_starts_with($empty, 'raw|') ? substr($empty, 4) : $this->make($empty)->render(); } @@ -307,7 +320,7 @@ protected function getExtension($path) $extensions = array_keys($this->extensions); return Arr::first($extensions, function ($value) use ($path) { - return Str::endsWith($path, '.'.$value); + return str_ends_with($path, '.'.$value); }); } diff --git a/vendor/illuminate/view/FileViewFinder.php b/vendor/illuminate/view/FileViewFinder.php index a488a9d..5502fe5 100644 --- a/vendor/illuminate/view/FileViewFinder.php +++ b/vendor/illuminate/view/FileViewFinder.php @@ -145,9 +145,7 @@ protected function findInPaths($name, $paths) */ protected function getPossibleViewFiles($name) { - return array_map(function ($extension) use ($name) { - return str_replace('.', '/', $name).'.'.$extension; - }, $this->extensions); + return array_map(fn ($extension) => str_replace('.', '/', $name).'.'.$extension, $this->extensions); } /** diff --git a/vendor/illuminate/view/InvokableComponentVariable.php b/vendor/illuminate/view/InvokableComponentVariable.php index b9db657..0d43ae3 100644 --- a/vendor/illuminate/view/InvokableComponentVariable.php +++ b/vendor/illuminate/view/InvokableComponentVariable.php @@ -7,6 +7,7 @@ use Illuminate\Contracts\Support\DeferringDisplayableValue; use Illuminate\Support\Enumerable; use IteratorAggregate; +use Traversable; class InvokableComponentVariable implements DeferringDisplayableValue, IteratorAggregate { @@ -43,8 +44,7 @@ public function resolveDisplayableValue() * * @return \ArrayIterator */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { $result = $this->__invoke(); diff --git a/vendor/illuminate/view/View.php b/vendor/illuminate/view/View.php index a196935..62b297a 100644 --- a/vendor/illuminate/view/View.php +++ b/vendor/illuminate/view/View.php @@ -112,7 +112,7 @@ public function render(callable $callback = null) */ protected function renderContents() { - // We will keep track of the amount of views being rendered so we can flush + // We will keep track of the number of views being rendered so we can flush // the section after the complete rendering operation is done. This will // clear out the sections for any separate views that may be rendered. $this->factory->incrementRender(); @@ -122,7 +122,7 @@ protected function renderContents() $contents = $this->getContents(); // Once we've finished rendering the view, we'll decrement the render count - // so that each sections get flushed out next time a view is created and + // so that each section gets flushed out next time a view is created and // no old sections are staying around in the memory of an environment. $this->factory->decrementRender(); @@ -306,8 +306,7 @@ public function getEngine() * @param string $key * @return bool */ - #[\ReturnTypeWillChange] - public function offsetExists($key) + public function offsetExists($key): bool { return array_key_exists($key, $this->data); } @@ -318,8 +317,7 @@ public function offsetExists($key) * @param string $key * @return mixed */ - #[\ReturnTypeWillChange] - public function offsetGet($key) + public function offsetGet($key): mixed { return $this->data[$key]; } @@ -331,8 +329,7 @@ public function offsetGet($key) * @param mixed $value * @return void */ - #[\ReturnTypeWillChange] - public function offsetSet($key, $value) + public function offsetSet($key, $value): void { $this->with($key, $value); } @@ -343,8 +340,7 @@ public function offsetSet($key, $value) * @param string $key * @return void */ - #[\ReturnTypeWillChange] - public function offsetUnset($key) + public function offsetUnset($key): void { unset($this->data[$key]); } @@ -409,7 +405,7 @@ public function __call($method, $parameters) return $this->macroCall($method, $parameters); } - if (! Str::startsWith($method, 'with')) { + if (! str_starts_with($method, 'with')) { throw new BadMethodCallException(sprintf( 'Method %s::%s does not exist.', static::class, $method )); diff --git a/vendor/illuminate/view/ViewException.php b/vendor/illuminate/view/ViewException.php index e6797a2..77f9ee6 100644 --- a/vendor/illuminate/view/ViewException.php +++ b/vendor/illuminate/view/ViewException.php @@ -28,7 +28,7 @@ public function report() * Render the exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response + * @return \Illuminate\Http\Response|null */ public function render($request) { diff --git a/vendor/illuminate/view/ViewName.php b/vendor/illuminate/view/ViewName.php index 9b80333..2808b13 100644 --- a/vendor/illuminate/view/ViewName.php +++ b/vendor/illuminate/view/ViewName.php @@ -14,7 +14,7 @@ public static function normalize($name) { $delimiter = ViewFinderInterface::HINT_PATH_DELIMITER; - if (strpos($name, $delimiter) === false) { + if (! str_contains($name, $delimiter)) { return str_replace('/', '.', $name); } diff --git a/vendor/illuminate/view/ViewServiceProvider.php b/vendor/illuminate/view/ViewServiceProvider.php index 7eb731f..afae6bb 100644 --- a/vendor/illuminate/view/ViewServiceProvider.php +++ b/vendor/illuminate/view/ViewServiceProvider.php @@ -85,7 +85,13 @@ public function registerViewFinder() public function registerBladeCompiler() { $this->app->singleton('blade.compiler', function ($app) { - return tap(new BladeCompiler($app['files'], $app['config']['view.compiled']), function ($blade) { + return tap(new BladeCompiler( + $app['files'], + $app['config']['view.compiled'], + $app['config']->get('view.relative_hash', false) ? $app->basePath() : '', + $app['config']->get('view.cache', true), + $app['config']->get('view.compiled_extension', 'php'), + ), function ($blade) { $blade->component('dynamic-component', DynamicComponent::class); }); }); diff --git a/vendor/illuminate/view/composer.json b/vendor/illuminate/view/composer.json index 942435b..7487d55 100644 --- a/vendor/illuminate/view/composer.json +++ b/vendor/illuminate/view/composer.json @@ -14,15 +14,15 @@ } ], "require": { - "php": "^7.3|^8.0", + "php": "^8.0.2", "ext-json": "*", - "illuminate/collections": "^8.0", - "illuminate/container": "^8.0", - "illuminate/contracts": "^8.0", - "illuminate/events": "^8.0", - "illuminate/filesystem": "^8.0", - "illuminate/macroable": "^8.0", - "illuminate/support": "^8.0" + "illuminate/collections": "^9.0", + "illuminate/container": "^9.0", + "illuminate/contracts": "^9.0", + "illuminate/events": "^9.0", + "illuminate/filesystem": "^9.0", + "illuminate/macroable": "^9.0", + "illuminate/support": "^9.0" }, "autoload": { "psr-4": { @@ -31,7 +31,7 @@ }, "extra": { "branch-alias": { - "dev-master": "8.x-dev" + "dev-master": "9.x-dev" } }, "config": { diff --git a/vendor/nesbot/carbon/composer.json b/vendor/nesbot/carbon/composer.json index 74b7e5c..95660ff 100644 --- a/vendor/nesbot/carbon/composer.json +++ b/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,6 +19,12 @@ "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" + }, "require": { "php": "^7.1.8 || ^8.0", "ext-json": "*", @@ -34,11 +39,34 @@ "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", - "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "phpstan/phpstan": "^0.12.54 || ^1.0", + "phpunit/php-file-iterator": "^2.0.5", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", "squizlabs/php_codesniffer": "^3.4" }, + "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": { + "allow-plugins": { + "phpstan/extension-installer": true, + "composer/package-versions-deprecated": true + }, "process-timeout": 0, "sort-packages": true }, @@ -58,24 +86,6 @@ ] } }, - "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", @@ -91,10 +101,5 @@ "@phpunit", "@style-check" ] - }, - "support": { - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon", - "docs": "https://carbon.nesbot.com/docs" } } diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php new file mode 100644 index 0000000..eacd9c1 --- /dev/null +++ b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroStrongType.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +if (!class_exists(LazyMacro::class, false)) { + abstract class LazyMacro extends AbstractMacro + { + /** + * {@inheritdoc} + */ + public function getFileName(): ?string + { + return $this->reflectionFunction->getFileName(); + } + + /** + * {@inheritdoc} + */ + public function getStartLine(): ?int + { + return $this->reflectionFunction->getStartLine(); + } + + /** + * {@inheritdoc} + */ + public function getEndLine(): ?int + { + return $this->reflectionFunction->getEndLine(); + } + } +} diff --git a/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php new file mode 100644 index 0000000..3e9fcf4 --- /dev/null +++ b/vendor/nesbot/carbon/lazy/Carbon/PHPStan/MacroWeakType.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +if (!class_exists(LazyMacro::class, false)) { + abstract class LazyMacro extends AbstractMacro + { + /** + * {@inheritdoc} + * + * @return string|false + */ + public function getFileName() + { + return $this->reflectionFunction->getFileName(); + } + + /** + * {@inheritdoc} + * + * @return int|false + */ + public function getStartLine() + { + return $this->reflectionFunction->getStartLine(); + } + + /** + * {@inheritdoc} + * + * @return int|false + */ + public function getEndLine() + { + return $this->reflectionFunction->getEndLine(); + } + } +} diff --git a/vendor/nesbot/carbon/readme.md b/vendor/nesbot/carbon/readme.md index 5d82721..100e60f 100644 --- a/vendor/nesbot/carbon/readme.md +++ b/vendor/nesbot/carbon/readme.md @@ -126,6 +126,10 @@ Support this project by becoming a sponsor. Your logo will show up here with a l + + + + [[Become a sponsor](https://opencollective.com/Carbon#sponsor)] diff --git a/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php b/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php index 555e07a..9c8a430 100644 --- a/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php +++ b/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php @@ -68,12 +68,13 @@ abstract class AbstractTranslator extends Translation\Translator public static function get($locale = null) { $locale = $locale ?: 'en'; + $key = static::class === Translator::class ? $locale : static::class.'|'.$locale; - if (!isset(static::$singletons[$locale])) { - static::$singletons[$locale] = new static($locale); + if (!isset(static::$singletons[$key])) { + static::$singletons[$key] = new static($locale); } - return static::$singletons[$locale]; + return static::$singletons[$key]; } public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) @@ -249,11 +250,7 @@ protected function translate(?string $id, array $parameters = [], ?string $domai */ protected function loadMessagesFromFile($locale) { - if (isset($this->messages[$locale])) { - return true; - } - - return $this->resetMessages($locale); + return isset($this->messages[$locale]) || $this->resetMessages($locale); } /** @@ -337,7 +334,7 @@ public function setLocale($locale) $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); $getScore = function ($language) use ($completeLocaleChunks) { - return static::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); + return self::compareChunkLists($completeLocaleChunks, preg_split('/[_.-]+/', $language)); }; usort($locales, function ($first, $second) use ($getScore) { @@ -358,13 +355,13 @@ public function setLocale($locale) 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/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php index 15e2061..c3db850 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php +++ b/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; diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php index a2b99a7..3f7bef2 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -365,7 +365,7 @@ public function __construct($years = 1, $months = null, $weeks = null, $days = n if ($years instanceof DateInterval) { parent::__construct(static::getDateIntervalSpec($years)); $this->f = $years->f; - static::copyNegativeUnits($years, $this); + self::copyNegativeUnits($years, $this); return; } @@ -416,7 +416,7 @@ public static function getFactor($source, $target) { $source = self::standardizeUnit($source); $target = self::standardizeUnit($target); - $factors = static::getFlipCascadeFactors(); + $factors = self::getFlipCascadeFactors(); if (isset($factors[$source])) { [$to, $factor] = $factors[$source]; @@ -440,7 +440,7 @@ public static function getFactor($source, $target) * * @return int|null */ - public function getFactorWithDefault($source, $target) + public static function getFactorWithDefault($source, $target) { $factor = self::getFactor($source, $target); @@ -898,10 +898,10 @@ private static function castIntervalToClass(DateInterval $interval, string $clas } if ($interval instanceof self && is_a($className, self::class, true)) { - static::copyStep($interval, $instance); + self::copyStep($interval, $instance); } - static::copyNegativeUnits($interval, $instance); + self::copyNegativeUnits($interval, $instance); return $instance; } @@ -1435,11 +1435,9 @@ protected function getForHumansParameters($syntax = null, $short = false, $parts ]; } - 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 +1618,23 @@ public function forHumans($syntax = null, $short = false, $parts = -1, $options $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; + } } } @@ -1654,8 +1657,14 @@ public function forHumans($syntax = null, $short = false, $parts = -1, $options \count($intervalValues->getNonZeroValues()) > $parts && ($count = \count($keys = array_keys($intervalValues->getValuesSequence()))) > 1 ) { + $index = min($count, $previousCount - 1) - 2; + + if ($index < 0) { + break; + } + $intervalValues = $this->copy()->roundUnit( - $keys[min($count, $previousCount - 1) - 2], + $keys[$index], 1, $method ); @@ -1690,17 +1699,17 @@ public function forHumans($syntax = null, $short = false, $parts = -1, $options } } - $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; @@ -1708,7 +1717,7 @@ public function forHumans($syntax = null, $short = false, $parts = -1, $options } if (!$absolute) { - return $handleDeclensions($unitData['unit'], $count); + return $handleDeclensions($unitData['unit'], $count, $index, $parts); } return $this->translate($unitData['unit'], $interpolations, $count, $translator, $altNumbers); @@ -1720,7 +1729,7 @@ public function forHumans($syntax = null, $short = false, $parts = -1, $options 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; } @@ -1731,13 +1740,19 @@ public function forHumans($syntax = null, $short = false, $parts = -1, $options } // 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'; @@ -1808,15 +1823,15 @@ public function __toString() { $format = $this->localToStringFormat; - 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); } /** @@ -2227,7 +2242,7 @@ private function doCascade(bool $deep) unset($originalData['days']); $newData = $originalData; - foreach (static::getFlipCascadeFactors() as $source => [$target, $factor]) { + foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) { foreach (['source', 'target'] as $key) { if ($$key === 'dayz') { $$key = 'daysExcludeWeeks'; @@ -2317,7 +2332,7 @@ public function total($unit) $result = 0; $cumulativeFactor = 0; $unitFound = false; - $factors = static::getFlipCascadeFactors(); + $factors = self::getFlipCascadeFactors(); $daysPerWeek = static::getDaysPerWeek(); $values = [ @@ -2746,4 +2761,14 @@ public function ceil($precision = 1) { 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; + } + } } diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php index 197f370..1710dbb 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -163,6 +163,8 @@ * @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. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CarbonPeriod implements Iterator, Countable, JsonSerializable { @@ -173,17 +175,23 @@ class CarbonPeriod implements Iterator, Countable, JsonSerializable use Options; /** - * Built-in filters. + * Built-in filter for limit by recurrences. * - * @var string + * @var callable */ public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; + + /** + * Built-in filter for limit to an end. + * + * @var callable + */ public const END_DATE_FILTER = [self::class, 'filterEndDate']; /** * Special value which can be returned by filters to end iteration. Also a filter. * - * @var string + * @var callable */ public const END_ITERATION = [self::class, 'endIteration']; @@ -369,7 +377,7 @@ public static function instance($period) ); } - $class = \get_called_class(); + $class = static::class; $type = \gettype($period); throw new NotAPeriodException( @@ -476,8 +484,8 @@ protected static function parseIso8601($iso) $end = null; foreach (explode('/', $iso) as $key => $part) { - if ($key === 0 && preg_match('/^R([0-9]*)$/', $part, $match)) { - $parsed = \strlen($match[1]) ? (int) $match[1] : null; + if ($key === 0 && preg_match('/^R([0-9]*|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)) { @@ -647,10 +655,10 @@ public function __construct(...$arguments) $this->setTimezone($argument); } elseif ($this->dateInterval === null && ( - \is_string($argument) && preg_match( + (\is_string($argument) && preg_match( '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T0-9].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i', $argument - ) || + )) || $argument instanceof DateInterval || $argument instanceof Closure ) && @@ -1227,7 +1235,7 @@ public function resetFilters() */ 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.'); } @@ -1453,7 +1461,7 @@ public function toString() $parts = []; - $format = !$this->startDate->isStartOfDay() || $this->endDate && !$this->endDate->isStartOfDay() + $format = !$this->startDate->isStartOfDay() || ($this->endDate && !$this->endDate->isStartOfDay()) ? 'Y-m-d H:i:s' : 'Y-m-d'; @@ -2173,7 +2181,10 @@ public function ceilUnit($unit, $precision = 1) */ public function round($precision = null, $function = 'round') { - return $this->roundWith($precision ?? (string) $this->getDateInterval(), $function); + return $this->roundWith( + $precision ?? $this->getDateInterval()->setLocalTranslator(TranslatorImmutable::get('en'))->forHumans(), + $function + ); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php index b4d16ba..9ecd339 100644 --- a/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php +++ b/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php @@ -30,7 +30,7 @@ protected static function parseNumericTimezone($timezone) 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 @@ public static function instance($object = null, $objectDump = null) $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 @@ public function toRegionTimeZone(DateTimeInterface $date = null) { $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; } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php index 8f2fdee..ecfe17e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php +++ b/vendor/nesbot/carbon/src/Carbon/Doctrine/CarbonTypeConverter.php @@ -36,9 +36,16 @@ protected function getCarbonClassName(): string */ public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) { - $precision = ($fieldDeclaration['precision'] ?: 10) === 10 - ? DateTimeDefaultPrecision::get() - : $fieldDeclaration['precision']; + $precision = $fieldDeclaration['precision'] ?: 10; + + if ($fieldDeclaration['secondPrecision'] ?? false) { + $precision = 0; + } + + if ($precision === 10) { + $precision = DateTimeDefaultPrecision::get(); + } + $type = parent::getSQLDeclaration($fieldDeclaration, $platform); if (!$precision) { diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php index b3a0871..3ca8837 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php index d5cd556..2e222e5 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php index 1d7ec54..4ceaa2e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php index 73c2dd8..108206d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php @@ -13,4 +13,5 @@ interface BadMethodCallException extends Exception { + // } diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php index 3bbbd77..8ad747e 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php @@ -13,4 +13,5 @@ interface Exception { + // } diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php index a48d4f9..db334c6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php index 9739f4d..5b013cd 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php @@ -13,4 +13,5 @@ interface InvalidArgumentException extends Exception { + // } diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php index d2f3701..a421401 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php index 99bb91c..c9ecb6b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php index 3341b49..92d55fe 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php index 5f9f142..69cf412 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php index a37e3f5..9bd84a9 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php index ede4771..cf2c902 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php index 892e16e..f725955 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php index 3fbe3fc..2c8ec9b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php index 2b4c48e..7a87632 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php index 41bb629..4edd7a4 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php index adbc36c..f2c5468 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php index 54822d9..2c586d0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php index 0314c5d..5416fd1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php index 24bf5a6..ad196f7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php +++ b/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php @@ -13,4 +13,5 @@ interface RuntimeException extends Exception { + // } diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php index 8bd8653..ee99953 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php index 39ee12c..0e72305 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php index 6c8c01b..5c50497 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php index 901db98..75273a7 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php index c9e9c9f..a795f5d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php index d965c82..ecd7f7a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php index 6f8b39f..1654ab1 100644 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php +++ b/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/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php b/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php new file mode 100644 index 0000000..ad9a449 --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php @@ -0,0 +1,89 @@ + + * + * 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/vendor/nesbot/carbon/src/Carbon/Lang/cy.php b/vendor/nesbot/carbon/src/Carbon/Lang/cy.php index ab7c45a..119274f 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cy.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/cy.php @@ -60,7 +60,7 @@ '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/vendor/nesbot/carbon/src/Carbon/Lang/da.php b/vendor/nesbot/carbon/src/Carbon/Lang/da.php index 4e6640a..322f91d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da.php +++ b/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 @@ '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 @@ ], '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/vendor/nesbot/carbon/src/Carbon/Lang/en.php b/vendor/nesbot/carbon/src/Carbon/Lang/en.php index a8633fe..f81f617 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/en.php @@ -72,7 +72,7 @@ $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/vendor/nesbot/carbon/src/Carbon/Lang/fr.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr.php index 73fe5e4..8c81ec6 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/fr.php @@ -90,7 +90,7 @@ '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' : ''); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php index 717d199..38c6434 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php +++ b/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 @@ '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/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php index f80b25e..f0196c0 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php @@ -54,28 +54,11 @@ 's' => ':count sek.', 'ago' => ':time temu', 'from_now' => static function ($time) { - switch ($time) { - case '1 godzina': - return 'za 1 godzinę'; - - case '1 minuta': - return 'za 1 minutę'; - - case '1 sekunda': - return 'za 1 sekundę'; - - case 'godzina': - return 'za godzinę'; - - case 'minuta': - return 'za minutę'; - - case 'sekunda': - return 'za sekundę'; - - default: - return "za $time"; - } + return 'za '.strtr($time, [ + 'godzina' => 'godzinę', + 'minuta' => 'minutę', + 'sekunda' => 'sekundę', + ]); }, 'after' => ':time po', 'before' => ':time przed', diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ss.php b/vendor/nesbot/carbon/src/Carbon/Lang/ss.php index cd4b919..1c52c9b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ss.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/ss.php @@ -50,7 +50,7 @@ $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/vendor/nesbot/carbon/src/Carbon/Lang/sv.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv.php index ca33e1c..1706c71 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/sv.php @@ -70,7 +70,7 @@ $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/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php b/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php index 4b0b541..9adddcf 100644 --- a/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php +++ b/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php @@ -33,9 +33,9 @@ 'm' => ':count mjeśůnc', 'a_month' => ':count mjeśůnc', - 'week' => ':count Tydźyń', - 'w' => ':count Tydźyń', - 'a_week' => ':count Tydźyń', + 'week' => ':count tydźyń', + 'w' => ':count tydźyń', + 'a_week' => ':count tydźyń', 'day' => ':count dźyń', 'd' => ':count dźyń', @@ -45,11 +45,11 @@ 'h' => ':count godzina', 'a_hour' => ':count godzina', - 'minute' => ':count Minuta', - 'min' => ':count Minuta', - 'a_minute' => ':count Minuta', + 'minute' => ':count minuta', + 'min' => ':count minuta', + 'a_minute' => ':count minuta', - 'second' => ':count Sekůnda', - 's' => ':count Sekůnda', - 'a_second' => ':count Sekůnda', + 'second' => ':count sekůnda', + 's' => ':count sekůnda', + 'a_second' => ':count sekůnda', ]); diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php new file mode 100644 index 0000000..fc6fd2a --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/AbstractMacro.php @@ -0,0 +1,222 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +use Closure; +use PHPStan\Reflection\Php\BuiltinMethodReflection; +use PHPStan\TrinaryLogic; +use ReflectionClass; +use ReflectionFunction; +use ReflectionMethod; +use ReflectionParameter; +use ReflectionType; +use stdClass; +use Throwable; + +abstract class AbstractMacro implements BuiltinMethodReflection +{ + /** + * The reflection function/method. + * + * @var ReflectionFunction|ReflectionMethod + */ + protected $reflectionFunction; + + /** + * The class name. + * + * @var class-string + */ + private $className; + + /** + * The method name. + * + * @var string + */ + private $methodName; + + /** + * The parameters. + * + * @var ReflectionParameter[] + */ + private $parameters; + + /** + * The is static. + * + * @var bool + */ + private $static = false; + + /** + * Macro constructor. + * + * @param string $className + * @phpstan-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) + ? new ReflectionMethod($macro[0], $macro[1]) + : new ReflectionFunction($macro); + $this->parameters = $this->reflectionFunction->getParameters(); + + if ($this->reflectionFunction->isClosure()) { + try { + $closure = $this->reflectionFunction->getClosure(); + $boundClosure = Closure::bind($closure, new stdClass()); + $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); + } catch (Throwable $e) { + $this->static = true; + } + } + } + + /** + * {@inheritdoc} + */ + public function getDeclaringClass(): ReflectionClass + { + return new ReflectionClass($this->className); + } + + /** + * {@inheritdoc} + */ + public function isPrivate(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isPublic(): bool + { + return true; + } + + /** + * {@inheritdoc} + */ + public function isFinal(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isInternal(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isAbstract(): bool + { + return false; + } + + /** + * {@inheritdoc} + */ + public function isStatic(): bool + { + return $this->static; + } + + /** + * {@inheritdoc} + */ + public function getDocComment(): ?string + { + return $this->reflectionFunction->getDocComment() ?: null; + } + + /** + * {@inheritdoc} + */ + public function getName(): string + { + return $this->methodName; + } + + /** + * {@inheritdoc} + */ + public function getParameters(): array + { + return $this->parameters; + } + + /** + * {@inheritdoc} + */ + public function getReturnType(): ?ReflectionType + { + return $this->reflectionFunction->getReturnType(); + } + + /** + * {@inheritdoc} + */ + public function isDeprecated(): TrinaryLogic + { + return TrinaryLogic::createFromBoolean( + $this->reflectionFunction->isDeprecated() || + preg_match('/@deprecated/i', $this->getDocComment() ?: '') + ); + } + + /** + * {@inheritdoc} + */ + public function isVariadic(): bool + { + return $this->reflectionFunction->isVariadic(); + } + + /** + * {@inheritdoc} + */ + public function getPrototype(): BuiltinMethodReflection + { + return $this; + } + + /** + * {@inheritdoc} + */ + public function getReflection(): ?ReflectionMethod + { + return $this->reflectionFunction instanceof ReflectionMethod + ? $this->reflectionFunction + : null; + } + + public function getTentativeReturnType(): ?ReflectionType + { + return null; + } +} diff --git a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php index baee204..8392587 100644 --- a/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php +++ b/vendor/nesbot/carbon/src/Carbon/PHPStan/Macro.php @@ -13,235 +13,15 @@ namespace Carbon\PHPStan; -use Closure; use PHPStan\Reflection\Php\BuiltinMethodReflection; -use PHPStan\TrinaryLogic; -use ReflectionClass; -use ReflectionFunction; use ReflectionMethod; -use ReflectionParameter; -use ReflectionType; -use stdClass; -use Throwable; -final class Macro implements BuiltinMethodReflection -{ - /** - * The class name. - * - * @var class-string - */ - private $className; - - /** - * The method name. - * - * @var string - */ - private $methodName; - - /** - * The reflection function/method. - * - * @var ReflectionFunction|ReflectionMethod - */ - private $reflectionFunction; - - /** - * The parameters. - * - * @var ReflectionParameter[] - */ - private $parameters; - - /** - * The is static. - * - * @var bool - */ - private $static = false; - - /** - * Macro constructor. - * - * @param string $className - * @phpstan-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) - ? new ReflectionMethod($macro[0], $macro[1]) - : new ReflectionFunction($macro); - $this->parameters = $this->reflectionFunction->getParameters(); - - if ($this->reflectionFunction->isClosure()) { - try { - $closure = $this->reflectionFunction->getClosure(); - $boundClosure = Closure::bind($closure, new stdClass()); - $this->static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); - } catch (Throwable $e) { - $this->static = true; - } - } - } - - /** - * {@inheritdoc} - */ - public function getDeclaringClass(): ReflectionClass - { - return new ReflectionClass($this->className); - } - - /** - * {@inheritdoc} - */ - public function isPrivate(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isPublic(): bool - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isFinal(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isInternal(): bool - { - return false; - } +$method = new ReflectionMethod(BuiltinMethodReflection::class, 'getFileName'); - /** - * {@inheritdoc} - */ - public function isAbstract(): bool - { - return false; - } +require $method->hasReturnType() + ? __DIR__.'/../../../lazy/Carbon/PHPStan/MacroStrongType.php' + : __DIR__.'/../../../lazy/Carbon/PHPStan/MacroWeakType.php'; - /** - * {@inheritdoc} - */ - public function isStatic(): bool - { - return $this->static; - } - - /** - * {@inheritdoc} - */ - public function getDocComment(): ?string - { - return $this->reflectionFunction->getDocComment() ?: null; - } - - /** - * {@inheritdoc} - * - * @return string|false - */ - public function getFileName() - { - return $this->reflectionFunction->getFileName(); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return $this->methodName; - } - - /** - * {@inheritdoc} - */ - public function getParameters(): array - { - return $this->parameters; - } - - /** - * {@inheritdoc} - */ - public function getReturnType(): ?ReflectionType - { - return $this->reflectionFunction->getReturnType(); - } - - /** - * {@inheritdoc} - * - * @return int|false - */ - public function getStartLine() - { - return $this->reflectionFunction->getStartLine(); - } - - /** - * {@inheritdoc} - * - * @return int|false - */ - public function getEndLine() - { - return $this->reflectionFunction->getEndLine(); - } - - /** - * {@inheritdoc} - */ - public function isDeprecated(): TrinaryLogic - { - return TrinaryLogic::createFromBoolean( - $this->reflectionFunction->isDeprecated() || - preg_match('/@deprecated/i', $this->getDocComment() ?: '') - ); - } - - /** - * {@inheritdoc} - */ - public function isVariadic(): bool - { - return $this->reflectionFunction->isVariadic(); - } - - /** - * {@inheritdoc} - */ - public function getPrototype(): BuiltinMethodReflection - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function getReflection(): ?ReflectionMethod - { - return $this->reflectionFunction instanceof ReflectionMethod - ? $this->reflectionFunction - : null; - } +final class Macro extends LazyMacro +{ } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php index 68240b7..5e30243 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php @@ -75,7 +75,7 @@ public function eq($date): bool */ public function equalTo($date): bool { - return $this == $date; + return $this == $this->resolveCarbon($date); } /** @@ -155,7 +155,7 @@ public function gt($date): bool */ public function greaterThan($date): bool { - return $this > $date; + return $this > $this->resolveCarbon($date); } /** @@ -256,7 +256,7 @@ public function lt($date): bool */ public function lessThan($date): bool { - return $this < $date; + return $this < $this->resolveCarbon($date); } /** @@ -448,7 +448,7 @@ public function isWeekday() */ public function isWeekend() { - return \in_array($this->dayOfWeek, static::$weekendDays); + return \in_array($this->dayOfWeek, static::$weekendDays, true); } /** @@ -621,19 +621,19 @@ public function isSameUnit($unit, $date = null) '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; } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php index 8fe008a..12689dc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php @@ -628,7 +628,7 @@ public function toPeriod($end = null, $interval = null, $unit = null) $period->setDateInterval($interval); } - if (\is_int($end) || \is_string($end) && ctype_digit($end)) { + if (\is_int($end) || (\is_string($end) && ctype_digit($end))) { $period->setRecurrences($end); } elseif ($end) { $period->setEndDate($end); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php index f90195a..d1028b8 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php @@ -95,7 +95,7 @@ public function __construct($time = null, $tz = null) setlocale(LC_NUMERIC, $locale); } - static::setLastErrors(parent::getLastErrors()); + self::setLastErrors(parent::getLastErrors()); } /** @@ -368,7 +368,7 @@ private static function createNowInstance($tz) */ 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)); } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php index 023da4d..83fff3a 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Date.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -643,7 +643,7 @@ public function getTimezone() * * @return array */ - protected static function getRangesByUnit() + protected static function getRangesByUnit(int $daysInMonth = 31): array { return [ // @call roundUnit @@ -651,7 +651,7 @@ protected static function getRangesByUnit() // @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 +940,7 @@ public function get($name) 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': @@ -1259,7 +1259,7 @@ protected function getTranslatedFormByRegExp($baseKey, $keySuffix, $context, $su 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; } @@ -1694,7 +1694,7 @@ private static function getFirstDayOfWeek(): int public static function getWeekStartsAt() { if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return static::getFirstDayOfWeek(); + return self::getFirstDayOfWeek(); } return static::$weekStartsAt; @@ -1725,7 +1725,7 @@ public static function setWeekStartsAt($day) public static function getWeekEndsAt() { if (static::$weekStartsAt === static::WEEK_DAY_AUTO) { - return (int) (static::DAYS_PER_WEEK - 1 + static::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; + return (int) (static::DAYS_PER_WEEK - 1 + self::getFirstDayOfWeek()) % static::DAYS_PER_WEEK; } return static::$weekEndsAt; @@ -1848,7 +1848,10 @@ public function formatLocalized($format) $format = preg_replace('#(?toDateTimeString())); + $time = strtotime($this->toDateTimeString()); + $formatted = ($this->localStrictModeEnabled ?? static::isStrictModeEnabled()) + ? strftime($format, $time) + : @strftime($format, $time); return static::$utf8 ? utf8_encode($formatted) : $formatted; } @@ -2359,7 +2362,7 @@ public function getOffsetString($separator = ':') $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"; } @@ -2566,7 +2569,7 @@ public function __call($method, $parameters) 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 +2597,7 @@ public function __call($method, $parameters) $unit = strtolower(substr($unit, 3)); } - if (\in_array($unit, static::$units)) { + if (\in_array($unit, static::$units, true)) { return $this->setUnit($unit, ...$parameters); } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php index fa7a49f..ed82466 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -217,7 +217,7 @@ public function diffInWeeks($date = null, $absolute = true) */ public function diffInDays($date = null, $absolute = true) { - return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%a'); + return $this->getIntervalDayDiff($this->diff($this->resolveCarbon($date), $absolute)); } /** @@ -472,7 +472,7 @@ public function diffInRealMilliseconds($date = null, $absolute = true) */ 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); } /** @@ -518,7 +518,7 @@ public function floatDiffInDays($date = null, $absolute = true) return $hoursDiff / static::HOURS_PER_DAY; } - $daysDiff = (int) $interval->format('%r%a'); + $daysDiff = $this->getIntervalDayDiff($interval); return $daysDiff + fmod($hoursDiff, static::HOURS_PER_DAY) / static::HOURS_PER_DAY; } @@ -1149,4 +1149,21 @@ public function calendar($referenceTime = null, array $formats = []) return $this->isoFormat((string) $format); } + + private function getIntervalDayDiff(DateInterval $interval): int + { + $daysDiff = (int) $interval->format('%a'); + $sign = $interval->format('%r') === '-' ? -1 : 1; + + if (\is_int($interval->days) && + $interval->y === 0 && + $interval->m === 0 && + version_compare(PHP_VERSION, '8.1.0-dev', '<') && + abs($interval->d - $daysDiff) === 1 + ) { + $daysDiff = abs($interval->d); + } + + return $daysDiff * $sign; + } } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php index b3d01c7..4639228 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\LocaleAwareInterface; use Symfony\Contracts\Translation\TranslatorInterface as ContractsTranslatorInterface; -if (!interface_exists('Symfony\\Component\\Translation\\TranslatorInterface')) { +if (interface_exists('Symfony\\Contracts\\Translation\\TranslatorInterface') && + !interface_exists('Symfony\\Component\\Translation\\TranslatorInterface') +) { class_alias( 'Symfony\\Contracts\\Translation\\TranslatorInterface', 'Symfony\\Component\\Translation\\TranslatorInterface' @@ -454,7 +456,7 @@ public function locale(string $locale = null, ...$fallbackLocales) } } - $this->setLocalTranslator($translator); + $this->localTranslator = $translator; } return $this; @@ -555,17 +557,13 @@ public static function executeWithLocale($locale, $func) 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') - ); + ); }); } @@ -792,7 +790,7 @@ private static function translateWordsByKeys($keys, $messages, $key): array $parts = explode('|', $message); return $key === 'to' - ? static::cleanWordFromTranslationString(end($parts)) + ? self::cleanWordFromTranslationString(end($parts)) : '(?:'.implode('|', array_map([static::class, 'cleanWordFromTranslationString'], $parts)).')'; }, $keys); } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php index ac06084..88b251d 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -66,8 +66,8 @@ trait Mixin public static function mixin($mixin) { \is_string($mixin) && trait_exists($mixin) - ? static::loadMixinTrait($mixin) - : static::loadMixinClass($mixin); + ? self::loadMixinTrait($mixin) + : self::loadMixinClass($mixin); } /** @@ -115,7 +115,7 @@ private static function loadMixinTrait($trait) } // in case of errors not converted into exceptions - $closure = $closure ?? $closureBase; + $closure = $closure ?: $closureBase; return $closure(...\func_get_args()); }); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php index 3306239..c991a9b 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -52,7 +52,7 @@ public function roundUnit($unit, $precision = 1, $function = 'round') 'millisecond' => [1000, 'microsecond'], ]; $normalizedUnit = static::singularUnit($unit); - $ranges = array_merge(static::getRangesByUnit(), [ + $ranges = array_merge(static::getRangesByUnit($this->daysInMonth), [ // @call roundUnit 'microsecond' => [0, 999999], ]); @@ -93,7 +93,7 @@ public function roundUnit($unit, $precision = 1, $function = 'round') $delta = $maximum + 1 - $minimum; $factor /= $delta; $fraction *= $delta; - $arguments[0] += $this->$unit * $factor; + $arguments[0] += ($this->$unit - $minimum) * $factor; $changes[$unit] = round( $minimum + ($fraction ? $fraction * $function(($this->$unit - $minimum) / $fraction) : 0) ); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php index eebc69b..ee287be 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -142,7 +142,7 @@ public function __sleep() #[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(); diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php index d22988c..e0c9e80 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Test.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Test.php @@ -28,10 +28,17 @@ trait Test /** * A test Carbon instance to be returned when now instances are created. * - * @var static + * @var Closure|static|null */ protected static $testNow; + /** + * The timezone to resto to when clearing the time mock. + * + * @var string|null + */ + protected static $testDefaultTimezone; + /** * Set a Carbon instance (real or mock) to be returned when a "now" * instance is created. The provided instance will be returned @@ -52,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); } /** @@ -80,10 +85,14 @@ public static function setTestNow($testNow = null) * * /!\ 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) { + if ($testNow) { + self::$testDefaultTimezone = self::$testDefaultTimezone ?? date_default_timezone_get(); + } + $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; if ($useDateInstanceTimezone) { @@ -94,7 +103,12 @@ public static function setTestNowAndTimezone($testNow = null, $tz = null) if (!$useDateInstanceTimezone) { $now = static::getMockedTestNow(\func_num_args() === 1 ? null : $tz); - self::setDefaultTimezone($now->tzName, $now); + $tzName = $now ? $now->tzName : null; + self::setDefaultTimezone($tzName ?? self::$testDefaultTimezone ?? 'UTC', $now); + } + + if (!$testNow) { + self::$testDefaultTimezone = null; } } @@ -105,16 +119,20 @@ public static function setTestNowAndTimezone($testNow = null, $tz = null) * * /!\ Use this method for unit tests only. * - * @param Closure|static|string|false|null $testNow real or mock Carbon instance - * @param Closure|null $callback + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure|null $callback * * @return mixed */ public static function withTestNow($testNow = null, $callback = null) { static::setTestNow($testNow); - $result = $callback(); - static::setTestNow(); + + try { + $result = $callback(); + } finally { + static::setTestNow(); + } return $result; } diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php index 2cb5c48..c8c9bbc 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php @@ -63,7 +63,7 @@ public static function createFromTimestampUTC($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 @@ public function timestamp($unixTimestamp) */ public function getPreciseTimestamp($precision = 6) { - return round($this->rawFormat('Uu') / pow(10, 6 - $precision)); + return round(((float) $this->rawFormat('Uu')) / pow(10, 6 - $precision)); } /** diff --git a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php index 2902a8b..4fc7d23 100644 --- a/vendor/nesbot/carbon/src/Carbon/Traits/Units.php +++ b/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -60,8 +60,6 @@ public function addRealUnit($unit, $value = 1) case 'millisecond': return $this->addRealUnit('microsecond', $value * static::MICROSECONDS_PER_MILLISECOND); - break; - // @call addRealUnit case 'second': break; @@ -167,7 +165,7 @@ public static function isModifiableUnit($unit) 'weekday', ]; - return \in_array($unit, $modifiableUnits) || \in_array($unit, static::$units); + return \in_array($unit, $modifiableUnits, true) || \in_array($unit, static::$units, true); } /** @@ -264,7 +262,7 @@ public function addUnit($unit, $value = 1, $overflow = null) /** @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 +272,14 @@ public function addUnit($unit, $value = 1, $overflow = null) } $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; } diff --git a/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php new file mode 100644 index 0000000..ad36c67 --- /dev/null +++ b/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\ImmutableException; +use Symfony\Component\Config\ConfigCacheFactoryInterface; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +class TranslatorImmutable extends Translator +{ + /** @var bool */ + private $constructed = false; + + public function __construct($locale, MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + parent::__construct($locale, $formatter, $cacheDir, $debug); + $this->constructed = true; + } + + /** + * @codeCoverageIgnore + */ + public function setDirectories(array $directories) + { + $this->disallowMutation(__METHOD__); + + return parent::setDirectories($directories); + } + + public function setLocale($locale) + { + $this->disallowMutation(__METHOD__); + + return parent::setLocale($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setMessages($locale, $messages) + { + $this->disallowMutation(__METHOD__); + + return parent::setMessages($locale, $messages); + } + + /** + * @codeCoverageIgnore + */ + public function setTranslations($messages) + { + $this->disallowMutation(__METHOD__); + + return parent::setTranslations($messages); + } + + /** + * @codeCoverageIgnore + */ + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) + { + $this->disallowMutation(__METHOD__); + + parent::setConfigCacheFactory($configCacheFactory); + } + + public function resetMessages($locale = null) + { + $this->disallowMutation(__METHOD__); + + return parent::resetMessages($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setFallbackLocales(array $locales) + { + $this->disallowMutation(__METHOD__); + + parent::setFallbackLocales($locales); + } + + private function disallowMutation($method) + { + if ($this->constructed) { + throw new ImmutableException($method.' not allowed on '.static::class); + } + } +} diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json index 017f41e..baf6cd1 100644 --- a/vendor/psr/container/composer.json +++ b/vendor/psr/container/composer.json @@ -18,5 +18,10 @@ "psr-4": { "Psr\\Container\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } } } diff --git a/vendor/psr/container/src/ContainerInterface.php b/vendor/psr/container/src/ContainerInterface.php index cf8e7fd..b2cad40 100644 --- a/vendor/psr/container/src/ContainerInterface.php +++ b/vendor/psr/container/src/ContainerInterface.php @@ -32,5 +32,5 @@ public function get(string $id); * * @return bool */ - public function has(string $id); + public function has(string $id): bool; } diff --git a/vendor/psr/simple-cache/composer.json b/vendor/psr/simple-cache/composer.json index 2978fa5..f307a84 100644 --- a/vendor/psr/simple-cache/composer.json +++ b/vendor/psr/simple-cache/composer.json @@ -6,11 +6,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "autoload": { "psr-4": { @@ -19,7 +19,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "3.0.x-dev" } } } diff --git a/vendor/psr/simple-cache/src/CacheException.php b/vendor/psr/simple-cache/src/CacheException.php index eba5381..f61b24c 100644 --- a/vendor/psr/simple-cache/src/CacheException.php +++ b/vendor/psr/simple-cache/src/CacheException.php @@ -5,6 +5,6 @@ /** * Interface used for all types of exceptions thrown by the implementing library. */ -interface CacheException +interface CacheException extends \Throwable { } diff --git a/vendor/psr/simple-cache/src/CacheInterface.php b/vendor/psr/simple-cache/src/CacheInterface.php index 99e8d95..671e340 100644 --- a/vendor/psr/simple-cache/src/CacheInterface.php +++ b/vendor/psr/simple-cache/src/CacheInterface.php @@ -15,7 +15,7 @@ interface CacheInterface * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function get($key, $default = null); + public function get(string $key, mixed $default = null): mixed; /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. @@ -31,7 +31,7 @@ public function get($key, $default = null); * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function set($key, $value, $ttl = null); + public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool; /** * Delete an item from the cache by its unique key. @@ -43,28 +43,28 @@ public function set($key, $value, $ttl = null); * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function delete($key); + public function delete(string $key): bool; /** * Wipes clean the entire cache's keys. * * @return bool True on success and false on failure. */ - public function clear(); + public function clear(): bool; /** * Obtains multiple cache items by their unique keys. * - * @param iterable $keys A list of keys that can obtained in a single operation. - * @param mixed $default Default value to return for keys that do not exist. + * @param iterable $keys A list of keys that can be obtained in a single operation. + * @param mixed $default Default value to return for keys that do not exist. * - * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. + * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. * * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function getMultiple($keys, $default = null); + public function getMultiple(iterable $keys, mixed $default = null): iterable; /** * Persists a set of key => value pairs in the cache, with an optional TTL. @@ -80,12 +80,12 @@ public function getMultiple($keys, $default = null); * MUST be thrown if $values is neither an array nor a Traversable, * or if any of the $values are not a legal value. */ - public function setMultiple($values, $ttl = null); + public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool; /** * Deletes multiple cache items in a single operation. * - * @param iterable $keys A list of string-based keys to be deleted. + * @param iterable $keys A list of string-based keys to be deleted. * * @return bool True if the items were successfully removed. False if there was an error. * @@ -93,7 +93,7 @@ public function setMultiple($values, $ttl = null); * MUST be thrown if $keys is neither an array nor a Traversable, * or if any of the $keys are not a legal value. */ - public function deleteMultiple($keys); + public function deleteMultiple(iterable $keys): bool; /** * Determines whether an item is present in the cache. @@ -110,5 +110,5 @@ public function deleteMultiple($keys); * @throws \Psr\SimpleCache\InvalidArgumentException * MUST be thrown if the $key string is not a legal value. */ - public function has($key); + public function has(string $key): bool; } diff --git a/vendor/symfony/css-selector/CssSelectorConverter.php b/vendor/symfony/css-selector/CssSelectorConverter.php index bbb6afe..86ccb79 100644 --- a/vendor/symfony/css-selector/CssSelectorConverter.php +++ b/vendor/symfony/css-selector/CssSelectorConverter.php @@ -27,10 +27,10 @@ class CssSelectorConverter { private $translator; - private $cache; + private array $cache; - private static $xmlCache = []; - private static $htmlCache = []; + private static array $xmlCache = []; + private static array $htmlCache = []; /** * @param bool $html Whether HTML support should be enabled. Disable it for XML documents @@ -59,10 +59,8 @@ public function __construct(bool $html = true) * * Optionally, a prefix can be added to the resulting XPath * expression with the $prefix parameter. - * - * @return string */ - public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::') + public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string { return $this->cache[$prefix][$cssExpr] ?? $this->cache[$prefix][$cssExpr] = $this->translator->cssToXPath($cssExpr, $prefix); } diff --git a/vendor/symfony/css-selector/Exception/SyntaxErrorException.php b/vendor/symfony/css-selector/Exception/SyntaxErrorException.php index 7deacf9..f73860c 100644 --- a/vendor/symfony/css-selector/Exception/SyntaxErrorException.php +++ b/vendor/symfony/css-selector/Exception/SyntaxErrorException.php @@ -23,42 +23,27 @@ */ class SyntaxErrorException extends ParseException { - /** - * @return self - */ - public static function unexpectedToken(string $expectedValue, Token $foundToken) + public static function unexpectedToken(string $expectedValue, Token $foundToken): self { return new self(sprintf('Expected %s, but %s found.', $expectedValue, $foundToken)); } - /** - * @return self - */ - public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation) + public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation): self { return new self(sprintf('Unexpected pseudo-element "::%s" found %s.', $pseudoElement, $unexpectedLocation)); } - /** - * @return self - */ - public static function unclosedString(int $position) + public static function unclosedString(int $position): self { return new self(sprintf('Unclosed/invalid string at %s.', $position)); } - /** - * @return self - */ - public static function nestedNot() + public static function nestedNot(): self { return new self('Got nested ::not().'); } - /** - * @return self - */ - public static function stringAsFunctionArgument() + public static function stringAsFunctionArgument(): self { return new self('String not allowed as function argument.'); } diff --git a/vendor/symfony/css-selector/LICENSE b/vendor/symfony/css-selector/LICENSE index 9ff2d0d..88bf75b 100644 --- a/vendor/symfony/css-selector/LICENSE +++ b/vendor/symfony/css-selector/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2021 Fabien Potencier +Copyright (c) 2004-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/css-selector/Node/AbstractNode.php b/vendor/symfony/css-selector/Node/AbstractNode.php index 1306aea..d99e80a 100644 --- a/vendor/symfony/css-selector/Node/AbstractNode.php +++ b/vendor/symfony/css-selector/Node/AbstractNode.php @@ -23,17 +23,10 @@ */ abstract class AbstractNode implements NodeInterface { - /** - * @var string - */ - private $nodeName; + private string $nodeName; public function getNodeName(): string { - if (null === $this->nodeName) { - $this->nodeName = preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); - } - - return $this->nodeName; + return $this->nodeName ??= preg_replace('~.*\\\\([^\\\\]+)Node$~', '$1', static::class); } } diff --git a/vendor/symfony/css-selector/Node/AttributeNode.php b/vendor/symfony/css-selector/Node/AttributeNode.php index 0b6e0ee..bca91eb 100644 --- a/vendor/symfony/css-selector/Node/AttributeNode.php +++ b/vendor/symfony/css-selector/Node/AttributeNode.php @@ -24,10 +24,10 @@ class AttributeNode extends AbstractNode { private $selector; - private $namespace; - private $attribute; - private $operator; - private $value; + private ?string $namespace; + private string $attribute; + private string $operator; + private ?string $value; public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value) { diff --git a/vendor/symfony/css-selector/Node/ClassNode.php b/vendor/symfony/css-selector/Node/ClassNode.php index 1efca80..0e93768 100644 --- a/vendor/symfony/css-selector/Node/ClassNode.php +++ b/vendor/symfony/css-selector/Node/ClassNode.php @@ -24,7 +24,7 @@ class ClassNode extends AbstractNode { private $selector; - private $name; + private string $name; public function __construct(NodeInterface $selector, string $name) { diff --git a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php index a217a45..f5f9969 100644 --- a/vendor/symfony/css-selector/Node/CombinedSelectorNode.php +++ b/vendor/symfony/css-selector/Node/CombinedSelectorNode.php @@ -24,7 +24,7 @@ class CombinedSelectorNode extends AbstractNode { private $selector; - private $combinator; + private string $combinator; private $subSelector; public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector) diff --git a/vendor/symfony/css-selector/Node/ElementNode.php b/vendor/symfony/css-selector/Node/ElementNode.php index fbf8ea0..b05164f 100644 --- a/vendor/symfony/css-selector/Node/ElementNode.php +++ b/vendor/symfony/css-selector/Node/ElementNode.php @@ -23,8 +23,8 @@ */ class ElementNode extends AbstractNode { - private $namespace; - private $element; + private ?string $namespace; + private ?string $element; public function __construct(string $namespace = null, string $element = null) { diff --git a/vendor/symfony/css-selector/Node/FunctionNode.php b/vendor/symfony/css-selector/Node/FunctionNode.php index c464cf7..e91a166 100644 --- a/vendor/symfony/css-selector/Node/FunctionNode.php +++ b/vendor/symfony/css-selector/Node/FunctionNode.php @@ -26,8 +26,8 @@ class FunctionNode extends AbstractNode { private $selector; - private $name; - private $arguments; + private string $name; + private array $arguments; /** * @param Token[] $arguments diff --git a/vendor/symfony/css-selector/Node/HashNode.php b/vendor/symfony/css-selector/Node/HashNode.php index 94114c0..119b0d5 100644 --- a/vendor/symfony/css-selector/Node/HashNode.php +++ b/vendor/symfony/css-selector/Node/HashNode.php @@ -24,7 +24,7 @@ class HashNode extends AbstractNode { private $selector; - private $id; + private string $id; public function __construct(NodeInterface $selector, string $id) { diff --git a/vendor/symfony/css-selector/Node/PseudoNode.php b/vendor/symfony/css-selector/Node/PseudoNode.php index 12b7bd2..5d6325a 100644 --- a/vendor/symfony/css-selector/Node/PseudoNode.php +++ b/vendor/symfony/css-selector/Node/PseudoNode.php @@ -24,7 +24,7 @@ class PseudoNode extends AbstractNode { private $selector; - private $identifier; + private string $identifier; public function __construct(NodeInterface $selector, string $identifier) { diff --git a/vendor/symfony/css-selector/Node/SelectorNode.php b/vendor/symfony/css-selector/Node/SelectorNode.php index 6e52b2f..55fae1e 100644 --- a/vendor/symfony/css-selector/Node/SelectorNode.php +++ b/vendor/symfony/css-selector/Node/SelectorNode.php @@ -24,7 +24,7 @@ class SelectorNode extends AbstractNode { private $tree; - private $pseudoElement; + private ?string $pseudoElement; public function __construct(NodeInterface $tree, string $pseudoElement = null) { diff --git a/vendor/symfony/css-selector/Node/Specificity.php b/vendor/symfony/css-selector/Node/Specificity.php index b00f6d2..bb8e5e3 100644 --- a/vendor/symfony/css-selector/Node/Specificity.php +++ b/vendor/symfony/css-selector/Node/Specificity.php @@ -29,9 +29,9 @@ class Specificity public const B_FACTOR = 10; public const C_FACTOR = 1; - private $a; - private $b; - private $c; + private int $a; + private int $b; + private int $c; public function __construct(int $a, int $b, int $c) { diff --git a/vendor/symfony/css-selector/Parser/Reader.php b/vendor/symfony/css-selector/Parser/Reader.php index 4b43eff..c0b6923 100644 --- a/vendor/symfony/css-selector/Parser/Reader.php +++ b/vendor/symfony/css-selector/Parser/Reader.php @@ -23,9 +23,9 @@ */ class Reader { - private $source; - private $length; - private $position = 0; + private string $source; + private int $length; + private int $position = 0; public function __construct(string $source) { @@ -60,10 +60,7 @@ public function getOffset(string $string) return false === $position ? false : $position - $this->position; } - /** - * @return array|false - */ - public function findPattern(string $pattern) + public function findPattern(string $pattern): array|false { $source = substr($this->source, $this->position); diff --git a/vendor/symfony/css-selector/Parser/Token.php b/vendor/symfony/css-selector/Parser/Token.php index a053203..a538d07 100644 --- a/vendor/symfony/css-selector/Parser/Token.php +++ b/vendor/symfony/css-selector/Parser/Token.php @@ -31,9 +31,9 @@ class Token public const TYPE_NUMBER = 'number'; public const TYPE_STRING = 'string'; - private $type; - private $value; - private $position; + private ?string $type; + private ?string $value; + private ?int $position; public function __construct(?string $type, ?string $value, ?int $position) { diff --git a/vendor/symfony/css-selector/Parser/TokenStream.php b/vendor/symfony/css-selector/Parser/TokenStream.php index 70d109f..e2c15a6 100644 --- a/vendor/symfony/css-selector/Parser/TokenStream.php +++ b/vendor/symfony/css-selector/Parser/TokenStream.php @@ -29,34 +29,23 @@ class TokenStream /** * @var Token[] */ - private $tokens = []; + private array $tokens = []; /** * @var Token[] */ - private $used = []; + private array $used = []; - /** - * @var int - */ - private $cursor = 0; - - /** - * @var Token|null - */ + private int $cursor = 0; private $peeked; - - /** - * @var bool - */ - private $peeking = false; + private bool $peeking = false; /** * Pushes a token. * * @return $this */ - public function push(Token $token): self + public function push(Token $token): static { $this->tokens[] = $token; @@ -68,7 +57,7 @@ public function push(Token $token): self * * @return $this */ - public function freeze(): self + public function freeze(): static { return $this; } @@ -120,8 +109,6 @@ public function getUsed(): array /** * Returns next identifier token. * - * @return string - * * @throws SyntaxErrorException If next token is not an identifier */ public function getNextIdentifier(): string @@ -138,8 +125,6 @@ public function getNextIdentifier(): string /** * Returns next identifier or null if star delimiter token is found. * - * @return string|null - * * @throws SyntaxErrorException If next token is not an identifier or a star delimiter */ public function getNextIdentifierOrStar(): ?string diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php index e0dcc5b..35c96a4 100644 --- a/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php +++ b/vendor/symfony/css-selector/Parser/Tokenizer/Tokenizer.php @@ -31,7 +31,7 @@ class Tokenizer /** * @var Handler\HandlerInterface[] */ - private $handlers; + private array $handlers; public function __construct() { diff --git a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php index 5f16ac4..0b2767a 100644 --- a/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php +++ b/vendor/symfony/css-selector/Parser/Tokenizer/TokenizerPatterns.php @@ -23,18 +23,18 @@ */ class TokenizerPatterns { - private $unicodeEscapePattern; - private $simpleEscapePattern; - private $newLineEscapePattern; - private $escapePattern; - private $stringEscapePattern; - private $nonAsciiPattern; - private $nmCharPattern; - private $nmStartPattern; - private $identifierPattern; - private $hashPattern; - private $numberPattern; - private $quotedStringPattern; + private string $unicodeEscapePattern; + private string $simpleEscapePattern; + private string $newLineEscapePattern; + private string $escapePattern; + private string $stringEscapePattern; + private string $nonAsciiPattern; + private string $nmCharPattern; + private string $nmStartPattern; + private string $identifierPattern; + private string $hashPattern; + private string $numberPattern; + private string $quotedStringPattern; public function __construct() { diff --git a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php index aa6f3f7..642702b 100644 --- a/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php +++ b/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php @@ -31,7 +31,7 @@ class NodeExtension extends AbstractExtension public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; - private $flags; + private int $flags; public function __construct(int $flags = 0) { @@ -41,7 +41,7 @@ public function __construct(int $flags = 0) /** * @return $this */ - public function setFlag(int $flag, bool $on): self + public function setFlag(int $flag, bool $on): static { if ($on && !$this->hasFlag($flag)) { $this->flags += $flag; diff --git a/vendor/symfony/css-selector/XPath/Translator.php b/vendor/symfony/css-selector/XPath/Translator.php index 8ce4730..c0bb29d 100644 --- a/vendor/symfony/css-selector/XPath/Translator.php +++ b/vendor/symfony/css-selector/XPath/Translator.php @@ -35,18 +35,18 @@ class Translator implements TranslatorInterface /** * @var ParserInterface[] */ - private $shortcutParsers = []; + private array $shortcutParsers = []; /** * @var Extension\ExtensionInterface[] */ - private $extensions = []; + private array $extensions = []; - private $nodeTranslators = []; - private $combinationTranslators = []; - private $functionTranslators = []; - private $pseudoClassTranslators = []; - private $attributeMatchingTranslators = []; + private array $nodeTranslators = []; + private array $combinationTranslators = []; + private array $functionTranslators = []; + private array $pseudoClassTranslators = []; + private array $attributeMatchingTranslators = []; public function __construct(ParserInterface $parser = null) { @@ -117,7 +117,7 @@ public function selectorToXPath(SelectorNode $selector, string $prefix = 'descen /** * @return $this */ - public function registerExtension(Extension\ExtensionInterface $extension): self + public function registerExtension(Extension\ExtensionInterface $extension): static { $this->extensions[$extension->getName()] = $extension; @@ -145,7 +145,7 @@ public function getExtension(string $name): Extension\ExtensionInterface /** * @return $this */ - public function registerParserShortcut(ParserInterface $shortcut): self + public function registerParserShortcut(ParserInterface $shortcut): static { $this->shortcutParsers[] = $shortcut; diff --git a/vendor/symfony/css-selector/XPath/XPathExpr.php b/vendor/symfony/css-selector/XPath/XPathExpr.php index e45ce7d..a76e30b 100644 --- a/vendor/symfony/css-selector/XPath/XPathExpr.php +++ b/vendor/symfony/css-selector/XPath/XPathExpr.php @@ -23,9 +23,9 @@ */ class XPathExpr { - private $path; - private $element; - private $condition; + private string $path; + private string $element; + private string $condition; public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false) { @@ -46,7 +46,7 @@ public function getElement(): string /** * @return $this */ - public function addCondition(string $condition): self + public function addCondition(string $condition): static { $this->condition = $this->condition ? sprintf('(%s) and (%s)', $this->condition, $condition) : $condition; @@ -61,7 +61,7 @@ public function getCondition(): string /** * @return $this */ - public function addNameTest(): self + public function addNameTest(): static { if ('*' !== $this->element) { $this->addCondition('name() = '.Translator::getXpathLiteral($this->element)); @@ -74,7 +74,7 @@ public function addNameTest(): self /** * @return $this */ - public function addStarPrefix(): self + public function addStarPrefix(): static { $this->path .= '*/'; @@ -86,7 +86,7 @@ public function addStarPrefix(): self * * @return $this */ - public function join(string $combiner, self $expr): self + public function join(string $combiner, self $expr): static { $path = $this->__toString().$combiner; diff --git a/vendor/symfony/css-selector/composer.json b/vendor/symfony/css-selector/composer.json index f0b7124..7c9551c 100644 --- a/vendor/symfony/css-selector/composer.json +++ b/vendor/symfony/css-selector/composer.json @@ -20,8 +20,7 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "autoload": { "psr-4": { "Symfony\\Component\\CssSelector\\": "" }, diff --git a/vendor/symfony/deprecation-contracts/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore deleted file mode 100644 index c49a5d8..0000000 --- a/vendor/symfony/deprecation-contracts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor/ -composer.lock -phpunit.xml diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e26..0000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 4957933..0000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index 1c1b4ba..0000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.0.2" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index 2d56512..0000000 --- a/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void - { - @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); - } -} diff --git a/vendor/symfony/finder/CHANGELOG.md b/vendor/symfony/finder/CHANGELOG.md index 6a44e87..9e2fc5a 100644 --- a/vendor/symfony/finder/CHANGELOG.md +++ b/vendor/symfony/finder/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.0 +--- + + * Remove `Comparator::setTarget()` and `Comparator::setOperator()` + 5.4.0 ----- diff --git a/vendor/symfony/finder/Comparator/Comparator.php b/vendor/symfony/finder/Comparator/Comparator.php index 3af551f..f1ba97d 100644 --- a/vendor/symfony/finder/Comparator/Comparator.php +++ b/vendor/symfony/finder/Comparator/Comparator.php @@ -16,80 +16,40 @@ */ class Comparator { - private $target; - private $operator = '=='; + private string $target; + private string $operator; - public function __construct(string $target = null, string $operator = '==') + public function __construct(string $target, string $operator = '==') { - if (null === $target) { - trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); + if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { + throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); } $this->target = $target; - $this->doSetOperator($operator); + $this->operator = $operator; } /** * Gets the target value. - * - * @return string */ - public function getTarget() + public function getTarget(): string { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - return $this->target; } - /** - * @deprecated set the target via the constructor instead - */ - public function setTarget(string $target) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__); - - $this->target = $target; - } - /** * Gets the comparison operator. - * - * @return string */ - public function getOperator() + public function getOperator(): string { return $this->operator; } - /** - * Sets the comparison operator. - * - * @throws \InvalidArgumentException - * - * @deprecated set the operator via the constructor instead - */ - public function setOperator(string $operator) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__); - - $this->doSetOperator('' === $operator ? '==' : $operator); - } - /** * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool */ - public function test($test) + public function test(mixed $test): bool { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - switch ($this->operator) { case '>': return $test > $this->target; @@ -105,13 +65,4 @@ public function test($test) return $test == $this->target; } - - private function doSetOperator(string $operator): void - { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } } diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php index 8cc564c..e5772c4 100644 --- a/vendor/symfony/finder/Finder.php +++ b/vendor/symfony/finder/Finder.php @@ -45,27 +45,27 @@ class Finder implements \IteratorAggregate, \Countable public const IGNORE_DOT_FILES = 2; public const IGNORE_VCS_IGNORED_FILES = 4; - private $mode = 0; - private $names = []; - private $notNames = []; - private $exclude = []; - private $filters = []; - private $depths = []; - private $sizes = []; - private $followLinks = false; - private $reverseSorting = false; - private $sort = false; - private $ignore = 0; - private $dirs = []; - private $dates = []; - private $iterators = []; - private $contains = []; - private $notContains = []; - private $paths = []; - private $notPaths = []; - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; + private int $mode = 0; + private array $names = []; + private array $notNames = []; + private array $exclude = []; + private array $filters = []; + private array $depths = []; + private array $sizes = []; + private bool $followLinks = false; + private bool $reverseSorting = false; + private \Closure|int|false $sort = false; + private int $ignore = 0; + private array $dirs = []; + private array $dates = []; + private array $iterators = []; + private array $contains = []; + private array $notContains = []; + private array $paths = []; + private array $notPaths = []; + private bool $ignoreUnreadableDirs = false; + + private static array $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; public function __construct() { @@ -74,10 +74,8 @@ public function __construct() /** * Creates a new Finder. - * - * @return static */ - public static function create() + public static function create(): static { return new static(); } @@ -87,7 +85,7 @@ public static function create() * * @return $this */ - public function directories() + public function directories(): static { $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; @@ -99,7 +97,7 @@ public function directories() * * @return $this */ - public function files() + public function files(): static { $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; @@ -122,7 +120,7 @@ public function files() * @see DepthRangeFilterIterator * @see NumberComparator */ - public function depth($levels) + public function depth(string|int|array $levels): static { foreach ((array) $levels as $level) { $this->depths[] = new Comparator\NumberComparator($level); @@ -150,7 +148,7 @@ public function depth($levels) * @see DateRangeFilterIterator * @see DateComparator */ - public function date($dates) + public function date(string|array $dates): static { foreach ((array) $dates as $date) { $this->dates[] = new Comparator\DateComparator($date); @@ -175,7 +173,7 @@ public function date($dates) * * @see FilenameFilterIterator */ - public function name($patterns) + public function name(string|array $patterns): static { $this->names = array_merge($this->names, (array) $patterns); @@ -191,7 +189,7 @@ public function name($patterns) * * @see FilenameFilterIterator */ - public function notName($patterns) + public function notName(string|array $patterns): static { $this->notNames = array_merge($this->notNames, (array) $patterns); @@ -213,7 +211,7 @@ public function notName($patterns) * * @see FilecontentFilterIterator */ - public function contains($patterns) + public function contains(string|array $patterns): static { $this->contains = array_merge($this->contains, (array) $patterns); @@ -235,7 +233,7 @@ public function contains($patterns) * * @see FilecontentFilterIterator */ - public function notContains($patterns) + public function notContains(string|array $patterns): static { $this->notContains = array_merge($this->notContains, (array) $patterns); @@ -259,7 +257,7 @@ public function notContains($patterns) * * @see FilenameFilterIterator */ - public function path($patterns) + public function path(string|array $patterns): static { $this->paths = array_merge($this->paths, (array) $patterns); @@ -283,7 +281,7 @@ public function path($patterns) * * @see FilenameFilterIterator */ - public function notPath($patterns) + public function notPath(string|array $patterns): static { $this->notPaths = array_merge($this->notPaths, (array) $patterns); @@ -305,7 +303,7 @@ public function notPath($patterns) * @see SizeRangeFilterIterator * @see NumberComparator */ - public function size($sizes) + public function size(string|int|array $sizes): static { foreach ((array) $sizes as $size) { $this->sizes[] = new Comparator\NumberComparator($size); @@ -327,7 +325,7 @@ public function size($sizes) * * @see ExcludeDirectoryFilterIterator */ - public function exclude($dirs) + public function exclude(string|array $dirs): static { $this->exclude = array_merge($this->exclude, (array) $dirs); @@ -343,7 +341,7 @@ public function exclude($dirs) * * @see ExcludeDirectoryFilterIterator */ - public function ignoreDotFiles(bool $ignoreDotFiles) + public function ignoreDotFiles(bool $ignoreDotFiles): static { if ($ignoreDotFiles) { $this->ignore |= static::IGNORE_DOT_FILES; @@ -363,7 +361,7 @@ public function ignoreDotFiles(bool $ignoreDotFiles) * * @see ExcludeDirectoryFilterIterator */ - public function ignoreVCS(bool $ignoreVCS) + public function ignoreVCS(bool $ignoreVCS): static { if ($ignoreVCS) { $this->ignore |= static::IGNORE_VCS_FILES; @@ -381,7 +379,7 @@ public function ignoreVCS(bool $ignoreVCS) * * @return $this */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored) + public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static { if ($ignoreVCSIgnored) { $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; @@ -399,7 +397,7 @@ public function ignoreVCSIgnored(bool $ignoreVCSIgnored) * * @param string|string[] $pattern VCS patterns to ignore */ - public static function addVCSPattern($pattern) + public static function addVCSPattern(string|array $pattern) { foreach ((array) $pattern as $p) { self::$vcsPatterns[] = $p; @@ -419,7 +417,7 @@ public static function addVCSPattern($pattern) * * @see SortableIterator */ - public function sort(\Closure $closure) + public function sort(\Closure $closure): static { $this->sort = $closure; @@ -435,7 +433,7 @@ public function sort(\Closure $closure) * * @see SortableIterator */ - public function sortByName(bool $useNaturalSort = false) + public function sortByName(bool $useNaturalSort = false): static { $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; @@ -451,7 +449,7 @@ public function sortByName(bool $useNaturalSort = false) * * @see SortableIterator */ - public function sortByType() + public function sortByType(): static { $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; @@ -469,7 +467,7 @@ public function sortByType() * * @see SortableIterator */ - public function sortByAccessedTime() + public function sortByAccessedTime(): static { $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; @@ -481,7 +479,7 @@ public function sortByAccessedTime() * * @return $this */ - public function reverseSorting() + public function reverseSorting(): static { $this->reverseSorting = true; @@ -501,7 +499,7 @@ public function reverseSorting() * * @see SortableIterator */ - public function sortByChangedTime() + public function sortByChangedTime(): static { $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; @@ -519,7 +517,7 @@ public function sortByChangedTime() * * @see SortableIterator */ - public function sortByModifiedTime() + public function sortByModifiedTime(): static { $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; @@ -536,7 +534,7 @@ public function sortByModifiedTime() * * @see CustomFilterIterator */ - public function filter(\Closure $closure) + public function filter(\Closure $closure): static { $this->filters[] = $closure; @@ -548,7 +546,7 @@ public function filter(\Closure $closure) * * @return $this */ - public function followLinks() + public function followLinks(): static { $this->followLinks = true; @@ -562,7 +560,7 @@ public function followLinks() * * @return $this */ - public function ignoreUnreadableDirs(bool $ignore = true) + public function ignoreUnreadableDirs(bool $ignore = true): static { $this->ignoreUnreadableDirs = $ignore; @@ -578,7 +576,7 @@ public function ignoreUnreadableDirs(bool $ignore = true) * * @throws DirectoryNotFoundException if one of the directories does not exist */ - public function in($dirs) + public function in(string|array $dirs): static { $resolvedDirs = []; @@ -607,8 +605,7 @@ public function in($dirs) * * @throws \LogicException if the in() method has not been called */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): \Iterator { if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); @@ -651,7 +648,7 @@ public function getIterator() * * @throws \InvalidArgumentException when the given argument is not iterable */ - public function append(iterable $iterator) + public function append(iterable $iterator): static { if ($iterator instanceof \IteratorAggregate) { $this->iterators[] = $iterator->getIterator(); @@ -673,10 +670,8 @@ public function append(iterable $iterator) /** * Check if any results were found. - * - * @return bool */ - public function hasResults() + public function hasResults(): bool { foreach ($this->getIterator() as $_) { return true; @@ -687,11 +682,8 @@ public function hasResults() /** * Counts all the results collected by the iterators. - * - * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return iterator_count($this->getIterator()); } diff --git a/vendor/symfony/finder/Glob.php b/vendor/symfony/finder/Glob.php index 8447932..7fe8b1a 100644 --- a/vendor/symfony/finder/Glob.php +++ b/vendor/symfony/finder/Glob.php @@ -37,10 +37,8 @@ class Glob { /** * Returns a regexp which is the equivalent of the glob pattern. - * - * @return string */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') + public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#'): string { $firstByte = true; $escaping = false; diff --git a/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/vendor/symfony/finder/Iterator/CustomFilterIterator.php index f7bf19b..82ee81d 100644 --- a/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ b/vendor/symfony/finder/Iterator/CustomFilterIterator.php @@ -23,7 +23,7 @@ */ class CustomFilterIterator extends \FilterIterator { - private $filters = []; + private array $filters = []; /** * @param \Iterator $iterator The Iterator to filter @@ -45,11 +45,8 @@ public function __construct(\Iterator $iterator, array $filters) /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { $fileinfo = $this->current(); diff --git a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php index f592e19..718d42b 100644 --- a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ b/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php @@ -22,7 +22,7 @@ */ class DateRangeFilterIterator extends \FilterIterator { - private $comparators = []; + private array $comparators = []; /** * @param \Iterator $iterator @@ -37,11 +37,8 @@ public function __construct(\Iterator $iterator, array $comparators) /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { $fileinfo = $this->current(); diff --git a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php index f593a3f..1cddb5f 100644 --- a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ b/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php @@ -23,7 +23,7 @@ */ class DepthRangeFilterIterator extends \FilterIterator { - private $minDepth = 0; + private int $minDepth = 0; /** * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter @@ -40,11 +40,8 @@ public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { return $this->getInnerIterator()->getDepth() >= $this->minDepth; } diff --git a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php index d9e182c..467bc19 100644 --- a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -21,10 +21,10 @@ */ class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator { - private $iterator; - private $isRecursive; - private $excludedDirs = []; - private $excludedPattern; + private \Iterator $iterator; + private bool $isRecursive; + private array $excludedDirs = []; + private ?string $excludedPattern = null; /** * @param \Iterator $iterator The Iterator to filter @@ -52,11 +52,8 @@ public function __construct(\Iterator $iterator, array $directories) /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { return false; @@ -72,20 +69,12 @@ public function accept() return true; } - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren() + public function hasChildren(): bool { return $this->isRecursive && $this->iterator->hasChildren(); } - /** - * @return self - */ - #[\ReturnTypeWillChange] - public function getChildren() + public function getChildren(): self { $children = new self($this->iterator->getChildren(), []); $children->excludedDirs = $this->excludedDirs; diff --git a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php index 793ae35..2ed48fb 100644 --- a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ b/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php @@ -23,7 +23,7 @@ class FileTypeFilterIterator extends \FilterIterator public const ONLY_FILES = 1; public const ONLY_DIRECTORIES = 2; - private $mode; + private int $mode; /** * @param \Iterator $iterator The Iterator to filter @@ -38,11 +38,8 @@ public function __construct(\Iterator $iterator, int $mode) /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { $fileinfo = $this->current(); if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { diff --git a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php index 79f8c29..eaa7a5d 100644 --- a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ b/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php @@ -23,11 +23,8 @@ class FilecontentFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { if (!$this->matchRegexps && !$this->noMatchRegexps) { return true; @@ -51,10 +48,8 @@ public function accept() * Converts string to regexp if necessary. * * @param string $str Pattern: string or regexp - * - * @return string */ - protected function toRegex(string $str) + protected function toRegex(string $str): string { return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; } diff --git a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/vendor/symfony/finder/Iterator/FilenameFilterIterator.php index 77b3b24..05d9535 100644 --- a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ b/vendor/symfony/finder/Iterator/FilenameFilterIterator.php @@ -24,11 +24,8 @@ class FilenameFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { return $this->isAccepted($this->current()->getFilename()); } @@ -40,10 +37,8 @@ public function accept() * Glob strings are transformed with Glob::toRegex(). * * @param string $str Pattern: glob or regexp - * - * @return string */ - protected function toRegex(string $str) + protected function toRegex(string $str): string { return $this->isRegex($str) ? $str : Glob::toRegex($str); } diff --git a/vendor/symfony/finder/Iterator/LazyIterator.php b/vendor/symfony/finder/Iterator/LazyIterator.php index 32cc37f..71c4be8 100644 --- a/vendor/symfony/finder/Iterator/LazyIterator.php +++ b/vendor/symfony/finder/Iterator/LazyIterator.php @@ -18,11 +18,11 @@ */ class LazyIterator implements \IteratorAggregate { - private $iteratorFactory; + private \Closure $iteratorFactory; public function __construct(callable $iteratorFactory) { - $this->iteratorFactory = $iteratorFactory; + $this->iteratorFactory = $iteratorFactory instanceof \Closure ? $iteratorFactory : \Closure::fromCallable($iteratorFactory); } public function getIterator(): \Traversable diff --git a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php index 9905172..1e9e7ff 100644 --- a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ b/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php @@ -50,10 +50,8 @@ public function __construct(\Iterator $iterator, array $matchPatterns, array $no * If there is no regexps defined in the class, this method will accept the string. * Such case can be handled by child classes before calling the method if they want to * apply a different behavior. - * - * @return bool */ - protected function isAccepted(string $string) + protected function isAccepted(string $string): bool { // should at least not match one rule to exclude foreach ($this->noMatchRegexps as $regex) { @@ -79,12 +77,16 @@ protected function isAccepted(string $string) /** * Checks whether the string is a regex. - * - * @return bool */ - protected function isRegex(string $str) + protected function isRegex(string $str): bool { - if (preg_match('/^(.{3,}?)[imsxuADU]*$/', $str, $m)) { + $availableModifiers = 'imsxuADU'; + + if (\PHP_VERSION_ID >= 80200) { + $availableModifiers .= 'n'; + } + + if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { $start = substr($m[1], 0, 1); $end = substr($m[1], -1); @@ -104,8 +106,6 @@ protected function isRegex(string $str) /** * Converts string into regexp. - * - * @return string */ - abstract protected function toRegex(string $str); + abstract protected function toRegex(string $str): string; } diff --git a/vendor/symfony/finder/Iterator/PathFilterIterator.php b/vendor/symfony/finder/Iterator/PathFilterIterator.php index 7974c4e..bfe402a 100644 --- a/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ b/vendor/symfony/finder/Iterator/PathFilterIterator.php @@ -23,11 +23,8 @@ class PathFilterIterator extends MultiplePcreFilterIterator { /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { $filename = $this->current()->getRelativePathname(); @@ -49,10 +46,8 @@ public function accept() * Use only / as directory separator (on Windows also). * * @param string $str Pattern: regexp or dirname - * - * @return string */ - protected function toRegex(string $str) + protected function toRegex(string $str): string { return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; } diff --git a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index 27589cd..4c9779f 100644 --- a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -21,20 +21,13 @@ */ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator { - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $rewindable; + private bool $ignoreUnreadableDirs; + private ?bool $rewindable = null; // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; + private string $rootPath; + private string $subPath; + private string $directorySeparator = '/'; /** * @throws \RuntimeException @@ -55,17 +48,15 @@ public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs /** * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo */ - #[\ReturnTypeWillChange] - public function current() + public function current(): SplFileInfo { // the logic here avoids redoing the same work in all iterations - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = $this->getSubPath(); + if (!isset($this->subPath)) { + $this->subPath = $this->getSubPath(); } + $subPathname = $this->subPath; if ('' !== $subPathname) { $subPathname .= $this->directorySeparator; } @@ -78,13 +69,7 @@ public function current() return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); } - /** - * @param bool $allowLinks - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren($allowLinks = false) + public function hasChildren(bool $allowLinks = false): bool { $hasChildren = parent::hasChildren($allowLinks); @@ -103,12 +88,9 @@ public function hasChildren($allowLinks = false) } /** - * @return \RecursiveDirectoryIterator - * * @throws AccessDeniedException */ - #[\ReturnTypeWillChange] - public function getChildren() + public function getChildren(): \RecursiveDirectoryIterator { try { $children = parent::getChildren(); @@ -130,11 +112,8 @@ public function getChildren() /** * Do nothing for non rewindable stream. - * - * @return void */ - #[\ReturnTypeWillChange] - public function rewind() + public function rewind(): void { if (false === $this->isRewindable()) { return; @@ -145,10 +124,8 @@ public function rewind() /** * Checks if the stream is rewindable. - * - * @return bool */ - public function isRewindable() + public function isRewindable(): bool { if (null !== $this->rewindable) { return $this->rewindable; diff --git a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php index 575bf29..925830a 100644 --- a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ b/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php @@ -22,7 +22,7 @@ */ class SizeRangeFilterIterator extends \FilterIterator { - private $comparators = []; + private array $comparators = []; /** * @param \Iterator $iterator @@ -37,11 +37,8 @@ public function __construct(\Iterator $iterator, array $comparators) /** * Filters the iterator values. - * - * @return bool */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { $fileinfo = $this->current(); if (!$fileinfo->isFile()) { diff --git a/vendor/symfony/finder/Iterator/SortableIterator.php b/vendor/symfony/finder/Iterator/SortableIterator.php index 9afde5c..b6c34b6 100644 --- a/vendor/symfony/finder/Iterator/SortableIterator.php +++ b/vendor/symfony/finder/Iterator/SortableIterator.php @@ -28,8 +28,8 @@ class SortableIterator implements \IteratorAggregate public const SORT_BY_MODIFIED_TIME = 5; public const SORT_BY_NAME_NATURAL = 6; - private $iterator; - private $sort; + private \Traversable $iterator; + private \Closure|int $sort; /** * @param \Traversable $iterator @@ -37,7 +37,7 @@ class SortableIterator implements \IteratorAggregate * * @throws \InvalidArgumentException */ - public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) + public function __construct(\Traversable $iterator, int|callable $sort, bool $reverseOrder = false) { $this->iterator = $iterator; $order = $reverseOrder ? -1 : 1; @@ -75,17 +75,13 @@ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = } elseif (self::SORT_BY_NONE === $sort) { $this->sort = $order; } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; + $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : \Closure::fromCallable($sort); } else { throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); } } - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): \Traversable { if (1 === $this->sort) { return $this->iterator; diff --git a/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php index 2a84f4a..e27158c 100644 --- a/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ b/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php @@ -60,8 +60,6 @@ private function isIgnored(string $fileRealPath): bool foreach ($this->parentsDirectoryDownward($fileRealPath) as $parentDirectory) { if ($this->isIgnored($parentDirectory)) { - $ignored = true; - // rules in ignored directories are ignored, no need to check further. break; } diff --git a/vendor/symfony/finder/LICENSE b/vendor/symfony/finder/LICENSE index 9ff2d0d..88bf75b 100644 --- a/vendor/symfony/finder/LICENSE +++ b/vendor/symfony/finder/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2021 Fabien Potencier +Copyright (c) 2004-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php index 11604a2..867e8e8 100644 --- a/vendor/symfony/finder/SplFileInfo.php +++ b/vendor/symfony/finder/SplFileInfo.php @@ -18,8 +18,8 @@ */ class SplFileInfo extends \SplFileInfo { - private $relativePath; - private $relativePathname; + private string $relativePath; + private string $relativePathname; /** * @param string $file The file name @@ -37,10 +37,8 @@ public function __construct(string $file, string $relativePath, string $relative * Returns the relative path. * * This path does not contain the file name. - * - * @return string */ - public function getRelativePath() + public function getRelativePath(): string { return $this->relativePath; } @@ -49,10 +47,8 @@ public function getRelativePath() * Returns the relative path name. * * This path contains the file name. - * - * @return string */ - public function getRelativePathname() + public function getRelativePathname(): string { return $this->relativePathname; } @@ -67,11 +63,9 @@ public function getFilenameWithoutExtension(): string /** * Returns the contents of the file. * - * @return string - * * @throws \RuntimeException */ - public function getContents() + public function getContents(): string { set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); try { diff --git a/vendor/symfony/finder/composer.json b/vendor/symfony/finder/composer.json index ef19911..2e4b324 100644 --- a/vendor/symfony/finder/composer.json +++ b/vendor/symfony/finder/composer.json @@ -16,9 +16,7 @@ } ], "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" }, diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index b599095..693749f 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -80,7 +80,7 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -568,7 +568,7 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null } $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 = []; @@ -602,6 +602,9 @@ public static function mb_substitute_character($c = null) if (80000 > \PHP_VERSION_ID) { return false; } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); } diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md index 4efb599..478b40d 100644 --- a/vendor/symfony/polyfill-mbstring/README.md +++ b/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/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index 2ed7a74..9cd2e92 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" ] @@ -28,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php index 5fef511..362dd1a 100644 --- a/vendor/symfony/polyfill-php80/Php80.php +++ b/vendor/symfony/polyfill-php80/Php80.php @@ -100,6 +100,16 @@ public static function str_starts_with(string $haystack, string $needle): bool 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/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 0000000..fe6e691 --- /dev/null +++ b/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,103 @@ + + * + * 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 + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var int + */ + public $line; + + /** + * @var int + */ + public $pos; + + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return static[] + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md index 10b8ee4..3816c55 100644 --- a/vendor/symfony/polyfill-php80/README.md +++ b/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/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 0000000..72f1081 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,7 @@ +domains) { - $this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains()))); + $domains = []; + foreach ([$this->source, $this->target] as $catalogue) { + foreach ($catalogue->getDomains() as $domain) { + $domains[$domain] = $domain; + + if ($catalogue->all($domainIcu = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX)) { + $domains[$domainIcu] = $domainIcu; + } + } + } + + $this->domains = array_values($domains); } return $this->domains; diff --git a/vendor/symfony/translation/Command/TranslationPullCommand.php b/vendor/symfony/translation/Command/TranslationPullCommand.php index 7d9da1c..42513a8 100644 --- a/vendor/symfony/translation/Command/TranslationPullCommand.php +++ b/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -110,7 +110,7 @@ protected function configure() Full example: - php %command.full_name% provider --force --domains=messages,validators --locales=en + php %command.full_name% provider --force --domains=messages --domains=validators --locales=en This command pulls all translations associated with the messages and validators domains for the en locale. Local translations for the specified domains and locale are deleted if they're not present on the provider and overwritten if it's the case. diff --git a/vendor/symfony/translation/Command/TranslationPushCommand.php b/vendor/symfony/translation/Command/TranslationPushCommand.php index 9654ec6..795e68c 100644 --- a/vendor/symfony/translation/Command/TranslationPushCommand.php +++ b/vendor/symfony/translation/Command/TranslationPushCommand.php @@ -21,6 +21,7 @@ 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; @@ -102,7 +103,7 @@ protected function configure() Full example: - php %command.full_name% provider --force --delete-missing --domains=messages,validators --locales=en + php %command.full_name% provider --force --delete-missing --domains=messages --domains=validators --locales=en This command pushes all translations associated with the messages and validators domains for the en locale. Provider translations for the specified domains and locale are deleted if they're not present locally and overwritten if it's the case. @@ -129,6 +130,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $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/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php index a5bc688..0f7901d 100644 --- a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -62,9 +62,6 @@ public function reset() $this->data = []; } - /** - * @return array|Data - */ public function getMessages(): array|Data { return $this->data['messages'] ?? []; diff --git a/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php index 976c4c8..b85c066 100644 --- a/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php +++ b/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -85,7 +85,7 @@ public function process(ContainerBuilder $container) protected function processValue(mixed $value, bool $isRoot = false): mixed { if ($value instanceof Reference) { - if ((string) $value === 'translator') { + if ('translator' === (string) $value) { for ($i = $this->level - 1; $i >= 0; --$i) { $class = $this->definitions[$i]->getClass(); diff --git a/vendor/symfony/translation/LICENSE b/vendor/symfony/translation/LICENSE index 9ff2d0d..88bf75b 100644 --- a/vendor/symfony/translation/LICENSE +++ b/vendor/symfony/translation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2021 Fabien Potencier +Copyright (c) 2004-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Loader/XliffFileLoader.php index 85009b0..670e199 100644 --- a/vendor/symfony/translation/Loader/XliffFileLoader.php +++ b/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -57,7 +57,7 @@ public function load(mixed $resource, string $locale, string $domain = 'messages } else { $dom = XmlUtils::loadFile($resource); } - } catch (\InvalidArgumentException | XmlParsingException | InvalidXmlException $e) { + } catch (\InvalidArgumentException|XmlParsingException|InvalidXmlException $e) { throw new InvalidResourceException(sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e); } diff --git a/vendor/symfony/translation/PseudoLocalizationTranslator.php b/vendor/symfony/translation/PseudoLocalizationTranslator.php index 1d10e0c..848dc1d 100644 --- a/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ b/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -123,7 +123,7 @@ private function getParts(string $originalTrans): array 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, 0xFFFF, 0, 0xFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); $useInternalErrors = libxml_use_internal_errors(true); diff --git a/vendor/symfony/translation/Resources/data/parents.json b/vendor/symfony/translation/Resources/data/parents.json index 288f163..32a33cd 100644 --- a/vendor/symfony/translation/Resources/data/parents.json +++ b/vendor/symfony/translation/Resources/data/parents.json @@ -54,6 +54,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 +117,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/vendor/symfony/translation/Test/ProviderTestCase.php b/vendor/symfony/translation/Test/ProviderTestCase.php index dd72bff..5ae2682 100644 --- a/vendor/symfony/translation/Test/ProviderTestCase.php +++ b/vendor/symfony/translation/Test/ProviderTestCase.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Translation\Test; -use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; use Symfony\Component\HttpClient\MockHttpClient; @@ -55,17 +54,11 @@ protected function getClient(): MockHttpClient return $this->client ??= new MockHttpClient(); } - /** - * @return LoaderInterface&MockObject - */ protected function getLoader(): LoaderInterface { return $this->loader ??= $this->createMock(LoaderInterface::class); } - /** - * @return LoaderInterface&MockObject - */ protected function getLogger(): LoggerInterface { return $this->logger ??= $this->createMock(LoggerInterface::class); @@ -76,9 +69,6 @@ protected function getDefaultLocale(): string return $this->defaultLocale ??= 'en'; } - /** - * @return LoaderInterface&MockObject - */ protected function getXliffFileDumper(): XliffFileDumper { return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); diff --git a/vendor/symfony/translation/TranslatorBag.php b/vendor/symfony/translation/TranslatorBag.php index ffd109f..9be3458 100644 --- a/vendor/symfony/translation/TranslatorBag.php +++ b/vendor/symfony/translation/TranslatorBag.php @@ -94,7 +94,10 @@ public function intersect(TranslatorBagInterface $intersectBag): self $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/vendor/voku/html-min/CHANGELOG.md b/vendor/voku/html-min/CHANGELOG.md index 67993af..b7cf342 100644 --- a/vendor/voku/html-min/CHANGELOG.md +++ b/vendor/voku/html-min/CHANGELOG.md @@ -1,3 +1,18 @@ +# Changelog 4.5.0 (2022-06-09) + +- added possibility overwrite special script tags on minify process (thanks @hryvinskyi) +- fix some PHP 8.1 type errors + +# Changelog 4.4.10 (2022-03-13) + +- use a new version of "voku/simple_html_dom" (4.8.5) +- phpstan reported errors fixed + +# Changelog 4.4.9 (2022-03-09) + +- optimize regex for gigantic inputs +- use a new version of "voku/simple_html_dom" (4.8.4) + # Changelog 4.4.8 (2020-08-11) - remove content before "", otherwise DOMDocument cannot handle the input diff --git a/vendor/voku/html-min/README.md b/vendor/voku/html-min/README.md index 241facc..056357a 100644 --- a/vendor/voku/html-min/README.md +++ b/vendor/voku/html-min/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/voku/HtmlMin.svg?branch=master)](https://travis-ci.org/voku/HtmlMin) +[![Build Status](https://github.com/voku/HtmlMin/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/HtmlMin/actions) [![Coverage Status](https://coveralls.io/repos/github/voku/HtmlMin/badge.svg?branch=master)](https://coveralls.io/github/voku/HtmlMin?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a433ed2b3b7546b3a1c520310222a601)](https://www.codacy.com/app/voku/HtmlMin?utm_source=github.com&utm_medium=referral&utm_content=voku/HtmlMin&utm_campaign=Badge_Grade) [![Latest Stable Version](https://poser.pugx.org/voku/html-min/v/stable)](https://packagist.org/packages/voku/html-min) @@ -92,7 +92,7 @@ PS: you can use the "nocompress"-tag to keep the html e.g.: "\n foob 1) [Composer](https://getcomposer.org) is a prerequisite for running the tests. ``` -composer install voku/html-min +composer require voku/html-min ``` 2) The tests can be executed by running this command from the root directory: diff --git a/vendor/voku/html-min/composer.json b/vendor/voku/html-min/composer.json index b776571..d780786 100644 --- a/vendor/voku/html-min/composer.json +++ b/vendor/voku/html-min/composer.json @@ -14,16 +14,16 @@ "authors": [ { "name": "Lars Moelleken", - "homepage": "http://www.moelleken.org/" + "homepage": "https://www.moelleken.org/" } ], "require": { "php": ">=7.0.0", - "voku/simple_html_dom": "~4.7.23", + "voku/simple_html_dom": "~4.8.5", "ext-dom": "*" }, "require-dev": { - "phpunit/phpunit": "~6.0 || ~7.0" + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" }, "autoload": { "psr-4": { diff --git a/vendor/voku/html-min/renovate.json b/vendor/voku/html-min/renovate.json new file mode 100644 index 0000000..e1d7259 --- /dev/null +++ b/vendor/voku/html-min/renovate.json @@ -0,0 +1,11 @@ +{ + "extends": [ + "config:base", + ":preserveSemverRanges" + ], + "packageRules": [{ + "excludePackageNames": [ + "phpunit/phpunit" + ] + }] +} diff --git a/vendor/voku/html-min/src/voku/helper/HtmlMin.php b/vendor/voku/html-min/src/voku/helper/HtmlMin.php index e24e013..63e7cfd 100644 --- a/vendor/voku/html-min/src/voku/helper/HtmlMin.php +++ b/vendor/voku/html-min/src/voku/helper/HtmlMin.php @@ -303,7 +303,7 @@ class HtmlMin implements HtmlMinInterface /** * @var HtmlMinDomObserverInterface[]|\SplObjectStorage * - * @psalm-var \SplObjectStorage + * @psalm-var \SplObjectStorage */ private $domLoopObservers; @@ -327,6 +327,11 @@ class HtmlMin implements HtmlMinInterface */ private $templateLogicSyntaxInSpecialScriptTags; + /** + * @var string[]|null + */ + private $specialScriptTags; + /** * HtmlMin constructor. */ @@ -767,7 +772,6 @@ private function domNodeClosingTagOptional(\DOMNode $node): bool // // <-- However, a start tag must never be omitted if it has any attributes. - /** @noinspection InArrayCanBeUsedInspection */ return \in_array($tag_name, self::$optional_end_tags, true) || ( @@ -1107,7 +1111,7 @@ private function getDoctype(\DOMNode $node): string $tmpTypePublic = 'PUBLIC'; } - return 'name . '' + return 'name . ($child->publicId ? ' ' . $tmpTypePublic . ' "' . $child->publicId . '"' : '') . ($child->systemId ? ' ' . $tmpTypeSystem . ' "' . $child->systemId . '"' : '') . '>'; @@ -1372,13 +1376,25 @@ public function minify($html, $multiDecodeNewHtmlEntity = false): string // Remove extra white-space(s) between HTML attribute(s) if (\strpos($html, ' ') !== false) { - $html = (string) \preg_replace_callback( + $htmlCleaned = \preg_replace_callback( '#<([^/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(/?)>#', static function ($matches) { return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; }, $html ); + if ($htmlCleaned !== null) { + $html = (string)$htmlCleaned; + } else { + $htmlCleaned = (string) \preg_replace_callback( + '#<([^/\s<>!]+)(?:\s+([^<>]*)\s*|\s*)(/?)>#', + static function ($matches) { + return '<' . $matches[1] . \preg_replace('#([^\s=]+)(=([\'"]?)(.*?)\3)?(\s+|$)#su', ' $1$2', $matches[2]) . $matches[3] . '>'; + }, + $html + ); + $html = $htmlCleaned; + } } if ($this->doRemoveSpacesBetweenTags) { @@ -1566,6 +1582,10 @@ private function minifyHtmlDom($html, $multiDecodeNewHtmlEntity): string if ($this->templateLogicSyntaxInSpecialScriptTags !== null) { $dom->overwriteTemplateLogicSyntaxInSpecialScriptTags($this->templateLogicSyntaxInSpecialScriptTags); } + + if ($this->specialScriptTags !== null) { + $dom->overwriteSpecialScriptTags($this->specialScriptTags); + } $dom->getDocument()->preserveWhiteSpace = false; // remove redundant white space $dom->getDocument()->formatOutput = false; // do not formats output with indentation @@ -1574,7 +1594,7 @@ private function minifyHtmlDom($html, $multiDecodeNewHtmlEntity): string if (\stripos($html, ']*)?>/sui', $html, $matches_before_doctype) + \preg_match('/(^.*?)]*)?>/sui', $html, $matches_before_doctype) && \trim($matches_before_doctype[1]) ) { @@ -1583,7 +1603,6 @@ private function minifyHtmlDom($html, $multiDecodeNewHtmlEntity): string } // load dom - /** @noinspection UnusedFunctionResultInspection */ $dom->loadHtml($html); $this->withDocType = (\stripos($html, 'find('*') as $element) { + foreach ($dom->findMulti('*') as $element) { $this->notifyObserversAboutDomElementBeforeMinification($element); } @@ -1631,7 +1650,7 @@ private function minifyHtmlDom($html, $multiDecodeNewHtmlEntity): string $dom = $this->sumUpWhitespace($dom); } - foreach ($dom->find('*') as $element) { + foreach ($dom->findMulti('*') as $element) { // ------------------------------------------------------------------------- // Remove whitespace around tags. [protected html is still protected] @@ -1690,7 +1709,7 @@ private function notifyObserversAboutDomElementBeforeMinification(SimpleHtmlDomI */ private function protectTagHelper(HtmlDomParser $dom, string $selector): HtmlDomParser { - foreach ($dom->find($selector) as $element) { + foreach ($dom->findMulti($selector) as $element) { if ($element->isRemoved()) { continue; } @@ -1718,7 +1737,7 @@ private function protectTags(HtmlDomParser $dom): HtmlDomParser { $this->protectTagHelper($dom, 'code'); - foreach ($dom->find('script, style') as $element) { + foreach ($dom->findMulti('script, style') as $element) { if ($element->isRemoved()) { continue; } @@ -1737,7 +1756,7 @@ private function protectTags(HtmlDomParser $dom): HtmlDomParser ++$this->protected_tags_counter; } - foreach ($dom->find('//comment()') as $element) { + foreach ($dom->findMulti('//comment()') as $element) { if ($element->isRemoved()) { continue; } @@ -1777,7 +1796,7 @@ private function protectTags(HtmlDomParser $dom): HtmlDomParser */ private function removeComments(HtmlDomParser $dom): HtmlDomParser { - foreach ($dom->find('//comment()') as $commentWrapper) { + foreach ($dom->findMulti('//comment()') as $commentWrapper) { $comment = $commentWrapper->getNode(); $val = $comment->nodeValue; if (\strpos($val, '[') === false) { @@ -1879,8 +1898,7 @@ public function setSpecialHtmlComments(array $startingWith, array $endingWith = */ private function sumUpWhitespace(HtmlDomParser $dom): HtmlDomParser { - $text_nodes = $dom->find('//text()'); - foreach ($text_nodes as $text_node_wrapper) { + foreach ($dom->findMulti('//text()') as $text_node_wrapper) { /* @var $text_node \DOMNode */ $text_node = $text_node_wrapper->getNode(); $xp = $text_node->getNodePath(); @@ -1890,7 +1908,7 @@ private function sumUpWhitespace(HtmlDomParser $dom): HtmlDomParser $doSkip = false; foreach (self::$skipTagsForRemoveWhitespace as $pattern) { - if (\strpos($xp, "/${pattern}") !== false) { + if (\strpos($xp, '/' . $pattern) !== false) { $doSkip = true; break; @@ -1942,4 +1960,23 @@ public function overwriteTemplateLogicSyntaxInSpecialScriptTags(array $templateL return $this; } + + + /** + * @param string[] $specialScriptTags + * + * @return HtmlDomParser + */ + public function overwriteSpecialScriptTags(array $specialScriptTags): self + { + foreach ($specialScriptTags as $tag) { + if (!\is_string($tag)) { + throw new \InvalidArgumentException('SpecialScriptTags only allows string[]'); + } + } + + $this->specialScriptTags = $specialScriptTags; + + return $this; + } } diff --git a/vendor/voku/portable-ascii/CHANGELOG.md b/vendor/voku/portable-ascii/CHANGELOG.md index 6e5357d..12fc393 100644 --- a/vendor/voku/portable-ascii/CHANGELOG.md +++ b/vendor/voku/portable-ascii/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +### 2.0.1 (2022-03-08) + +- "To people of Russia": There is a war in Ukraine right now. The forces of the Russian Federation are attacking civilians. +- optimize some phpdocs + +### 2.0.0 (2022-01-24) + +- prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- fix "Persian" char-mapping (thanks to @frost-cyber) + +### 1.6.1 (2022-01-24) + +- revert: prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- revert: fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- revert: fix "Persian" char-mapping (thanks to @frost-cyber) + +### 1.6.0 (2022-01-24) + +- prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- fix "Persian" char-mapping (thanks to @frost-cyber) +- fix "ASCII::normalize_whitespace()" -> "CARRIAGE RETURN" is more like "
" and no "\n" +- add "ASCII::to_ascii_remap()" -> this method will return broken characters and is only for special cases + ### 1.5.6 (2020-11-12) - "ASCII::normalize_whitespace()" -> can now also remove "control characters" if needed v2 diff --git a/vendor/voku/portable-ascii/README.md b/vendor/voku/portable-ascii/README.md index 9dd7cec..3ce36d6 100644 --- a/vendor/voku/portable-ascii/README.md +++ b/vendor/voku/portable-ascii/README.md @@ -1,7 +1,9 @@ [//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/base.md) -[![Build Status](https://travis-ci.com/voku/portable-ascii.svg?branch=master)](https://travis-ci.com/voku/portable-ascii) +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) + +[![Build Status](https://github.com/voku/portable-ascii/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/portable-ascii/actions) [![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master) -[![Coverage Status](https://coveralls.io/repos/voku/portable-ascii/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-ascii?branch=master) +[![codecov.io](https://codecov.io/github/voku/portable-ascii/coverage.svg?branch=master)](https://codecov.io/github/voku/portable-ascii?branch=master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii) [![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii) [![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii) @@ -96,11 +98,12 @@ The API from the "ASCII"-Class is written as small static methods. getAllLanguages is_ascii normalize_msword -normalize_whitespace -remove_invisible_characters +normalize_whitespace +remove_invisible_characters to_ascii -to_filename -to_slugify +to_ascii_remap +to_filename +to_slugify to_transliterate @@ -152,7 +155,7 @@ echo $array['orig'][$tmpKey]; // 'ё' **Parameters:** -- `string $language [optional]

Language of the source string e.g.: en, de_at, or de-ch. +- `ASCII::* $language [optional]

Language of the source string e.g.: en, de_at, or de-ch. (default is 'en') | ASCII::*_LANGUAGE_CODE

` - `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

` - `bool $asOrigReplaceArray [optional]

TRUE === return {orig: string[], replace: string[]} @@ -254,7 +257,7 @@ ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."' -------- -#### normalize_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $replaceSeparatorsWithNewline): string +#### normalize_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $normalize_control_characters): string Normalize the whitespace. @@ -267,14 +270,14 @@ ASCII::normalize_whitespace("abc-\xc2\xa0-öäü-\xe2\x80\xaf-\xE2\x80\xAC", tru - `bool $keepNonBreakingSpace [optional]

Set to true, to keep non-breaking-spaces.

` - `bool $keepBidiUnicodeControls [optional]

Set to true, to keep non-printable (for the web) bidirectional text chars.

` -- `bool $replaceSeparatorsWithNewline [optional]

Set to true, to convert LINE and PARAGRAPH SEPARATOR with "\n".

` +- `bool $normalize_control_characters [optional]

Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

` **Return:** - `string

A string with normalized whitespace.

` -------- -#### remove_invisible_characters(string $str, bool $url_encoded, string $replacement, bool $keep_control_characters): string +#### remove_invisible_characters(string $str, bool $url_encoded, string $replacement, bool $keep_basic_control_characters): string Remove invisible characters from a string. @@ -286,7 +289,7 @@ copy&past from https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/C - `string $str` - `bool $url_encoded` - `string $replacement` -- `bool $keep_control_characters` +- `bool $keep_basic_control_characters` **Return:** - `string` @@ -308,7 +311,7 @@ ASCII::to_ascii('�Düsseldorf�', 'en'); // Dusseldorf **Parameters:** - `string $str

The input string.

` -- `string $language [optional]

Language of the source string. +- `ASCII::* $language [optional]

Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE

` - `bool $remove_unsupported_chars [optional]

Whether or not to remove the unsupported characters.

` @@ -325,6 +328,26 @@ language

` -------- +#### to_ascii_remap(string $str1, string $str2): string[] + +WARNING: This method will return broken characters and is only for special cases. + +Convert two UTF-8 encoded string to a single-byte strings suitable for +functions that need the same string length after the conversion. + +The function simply uses (and updates) a tailored dynamic encoding +(in/out map parameter) where non-ascii characters are remapped to +the range [128-255] in order of appearance. + +**Parameters:** +- `string $str1` +- `string $str2` + +**Return:** +- `string[]` + +-------- + #### to_filename(string $str, bool $use_transliterate, string $fallback_char): string Convert given string to safe filename (and keep string case). @@ -356,7 +379,7 @@ also be supplied for language-specific transliteration. **Parameters:** - `string $str` - `string $separator [optional]

The string used to replace whitespace.

` -- `string $language [optional]

Language of the source string. +- `ASCII::* $language [optional]

Language of the source string. (default is 'en') | ASCII::*_LANGUAGE_CODE

` - `array $replacements [optional]

A map of replaceable strings.

` - `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " diff --git a/vendor/voku/portable-ascii/build/composer.json b/vendor/voku/portable-ascii/build/composer.json deleted file mode 100644 index 30f30c3..0000000 --- a/vendor/voku/portable-ascii/build/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require-dev": { - "voku/php-readme-helper": "~0.6" - } -} diff --git a/vendor/voku/portable-ascii/build/docs/base.md b/vendor/voku/portable-ascii/build/docs/base.md deleted file mode 100644 index e21e731..0000000 --- a/vendor/voku/portable-ascii/build/docs/base.md +++ /dev/null @@ -1,127 +0,0 @@ -[![Build Status](https://travis-ci.com/voku/portable-ascii.svg?branch=master)](https://travis-ci.com/voku/portable-ascii) -[![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master) -[![Coverage Status](https://coveralls.io/repos/voku/portable-ascii/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-ascii?branch=master) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii) -[![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii) -[![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii) -[![License](https://poser.pugx.org/voku/portable-ascii/license)](https://packagist.org/packages/voku/portable-ascii) -[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken) -[![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku) - -# 🔡 Portable ASCII - -## Description - -It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server. - -The benefit of Portable ASCII is that it is easy to use, easy to bundle. - -The project based on ... -+ Sean M. Burke's work (https://metacpan.org/pod/Text::Unidecode) -+ Tomaz Solc's work (https://pypi.org/project/Unidecode/) -+ Portable UTF-8 work (https://github.com/voku/portable-utf8) -+ Daniel St. Jules's work (https://github.com/danielstjules/Stringy) -+ Johnny Broadway's work (https://github.com/jbroadway/urlify) -+ and many cherry-picks from "github"-gists and "Stack Overflow"-snippets ... - -## Index - -* [Alternative](#alternative) -* [Install](#install-portable-ascii-via-composer-require) -* [Why Portable ASCII?](#why-portable-ascii) -* [Requirements and Recommendations](#requirements-and-recommendations) -* [Usage](#usage) -* [Class methods](#class-methods) -* [Unit Test](#unit-test) -* [License and Copyright](#license-and-copyright) - -## Alternative - -If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable ASCII"-Class and some extra methods. - -```php -// Portable ASCII -use voku\helper\ASCII; -ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii' - -// voku/Stringy -use Stringy\Stringy as S; -$stringy = S::create('déjà σσς iıii'); -$stringy->toTransliterate(); // 'deja sss iiii' -``` - -## Install "Portable ASCII" via "composer require" -```shell -composer require voku/portable-ascii -``` - -## Why Portable ASCII?[]() -I need ASCII char handling in different classes and before I added this functions into "Portable UTF-8", -but this repo is more modular and portable, because it has no dependencies. - -## Requirements and Recommendations - -* No extensions are required to run this library. Portable ASCII only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\u" modifier support in PCRE for ASCII handling is not a must. -* PHP 7.0 is the minimum requirement -* PHP 8.0 is also supported - -## Usage - -Example: ASCII::to_ascii() -```php - echo ASCII::to_ascii('�Düsseldorf�', 'de'); - - // will output - // Duesseldorf - - echo ASCII::to_ascii('�Düsseldorf�', 'en'); - - // will output - // Dusseldorf -``` - -# Portable ASCII | API - -The API from the "ASCII"-Class is written as small static methods. - - -## Class methods - -%__functions_index__voku\helper\ASCII__% - -%__functions_list__voku\helper\ASCII__% - - -## Unit Test - -1) [Composer](https://getcomposer.org) is a prerequisite for running the tests. - -``` -composer install -``` - -2) The tests can be executed by running this command from the root directory: - -```bash -./vendor/bin/phpunit -``` - -### Support - -For support and donations please visit [Github](https://github.com/voku/portable-ascii/) | [Issues](https://github.com/voku/portable-ascii/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku). - -For status updates and release announcements please visit [Releases](https://github.com/voku/portable-ascii/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts). - -For professional support please contact [me](https://about.me/voku). - -### Thanks - -- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc. -- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm! -- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there! -- Thanks to [StyleCI](https://styleci.io/) for the simple but powerful code style check. -- Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code! - -### License and Copyright - -Released under the MIT License - see `LICENSE.txt` for details. diff --git a/vendor/voku/portable-ascii/build/generate_docs.php b/vendor/voku/portable-ascii/build/generate_docs.php deleted file mode 100644 index c86f1f1..0000000 --- a/vendor/voku/portable-ascii/build/generate_docs.php +++ /dev/null @@ -1,26 +0,0 @@ -templateMethod = <<↑ -%description% - -**Parameters:** -%params% - -**Return:** -%return% - --------- - -RAW; -$readmeText = ($readmeGenerator)->generate( - __DIR__ . '/../src/voku/helper/ASCII.php', - __DIR__ . '/docs/base.md' -); - -file_put_contents(__DIR__ . '/../README.md', $readmeText); diff --git a/vendor/voku/portable-ascii/build/generate_max_key_length.php b/vendor/voku/portable-ascii/build/generate_max_key_length.php deleted file mode 100644 index 743d389..0000000 --- a/vendor/voku/portable-ascii/build/generate_max_key_length.php +++ /dev/null @@ -1,20 +0,0 @@ - + * @phpstan-return array */ public static function getAllLanguages(): array { @@ -238,7 +254,7 @@ public static function getAllLanguages(): array * * @return array * - * @psalm-return array> + * @phpstan-return array> */ public static function charsArray(bool $replace_extra_symbols = false): array { @@ -268,13 +284,11 @@ public static function charsArray(bool $replace_extra_symbols = false): array * @return array *

An array of replacements.

* - * @psalm-return array> + * @phpstan-return array> */ public static function charsArrayWithMultiLanguageValues(bool $replace_extra_symbols = false): array { - /** - * @var array - */ + /** @var array>> */ static $CHARS_ARRAY = []; $cacheKey = '' . $replace_extra_symbols; @@ -300,10 +314,7 @@ public static function charsArrayWithMultiLanguageValues(bool $replace_extra_sym $CHARS_ARRAY[$cacheKey] = $return; - /** @noinspection PhpSillyAssignmentInspection - hack for phpstan */ - /** @var array> $return */ - $return = $return; - + /** @var array> $return - hack for phpstan */ return $return; } @@ -332,7 +343,8 @@ public static function charsArrayWithMultiLanguageValues(bool $replace_extra_sym * @return array *

An array of replacements.

* - * @psalm-return array{orig: string[], replace: string[]}|array + * @phpstan-param ASCII::*_LANGUAGE_CODE $language + * @phpstan-return array{orig: string[], replace: string[]}|array */ public static function charsArrayWithOneLanguage( string $language = self::ENGLISH_LANGUAGE_CODE, @@ -342,9 +354,7 @@ public static function charsArrayWithOneLanguage( $language = self::get_language($language); // init - /** - * @var array - */ + /** @var array|array{orig: string[], replace: string[]}>> */ static $CHARS_ARRAY = []; $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray; @@ -428,16 +438,14 @@ public static function charsArrayWithOneLanguage( * @return array *

An array of replacements.

* - * @psalm-return array{orig: string[], replace: string[]}|array + * @phpstan-return array{orig: string[], replace: string[]}|array */ public static function charsArrayWithSingleLanguageValues( bool $replace_extra_symbols = false, bool $asOrigReplaceArray = true ): array { // init - /** - * @var array - */ + /** @var array|array{orig: string[], replace: string[]}> */ static $CHARS_ARRAY = []; $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray; @@ -463,6 +471,7 @@ public static function charsArrayWithSingleLanguageValues( } } + /** @phpstan-ignore-next-line - ... error? */ $CHARS_ARRAY[$cacheKey] = \array_merge([], ...$CHARS_ARRAY[$cacheKey]); if ($asOrigReplaceArray) { @@ -581,19 +590,13 @@ public static function normalize_msword(string $str): string return ''; } - /** - * @var array{orig: string[], replace: string[]} - */ + /** @var array{orig: string[], replace: string[]} */ static $MSWORD_CACHE = ['orig' => [], 'replace' => []]; if (empty($MSWORD_CACHE['orig'])) { self::prepareAsciiMaps(); - /** - * @psalm-suppress PossiblyNullArrayAccess - we use the prepare* methods here, so we don't get NULL here - * - * @var array - */ + /** @var array */ $map = self::$ASCII_MAPS[self::EXTRA_MSWORD_CHARS_LANGUAGE_CODE] ?? []; $MSWORD_CACHE = [ @@ -616,7 +619,7 @@ public static function normalize_msword(string $str): string * @param bool $keepNonBreakingSpace [optional]

Set to true, to keep non-breaking-spaces.

* @param bool $keepBidiUnicodeControls [optional]

Set to true, to keep non-printable (for the web) * bidirectional text chars.

- * @param bool $normalize_control_characters [optional]

Set to true, to convert LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

+ * @param bool $normalize_control_characters [optional]

Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

* * @psalm-pure * @@ -633,9 +636,7 @@ public static function normalize_whitespace( return ''; } - /** - * @var array> - */ + /** @var array> */ static $WHITESPACE_CACHE = []; $cacheKey = (int) $keepNonBreakingSpace; @@ -645,16 +646,14 @@ public static function normalize_whitespace( "\x0d\x0c", // 'END OF LINE' "\xe2\x80\xa8", // 'LINE SEPARATOR' "\xe2\x80\xa9", // 'PARAGRAPH SEPARATOR' - "\x0c", // 'FORM FEED' - "\x0d", // 'CARRIAGE RETURN' - "\x0b", // 'VERTICAL TAB' + "\x0c", // 'FORM FEED' // "\f" + "\x0b", // 'VERTICAL TAB' // "\v" ], [ "\n", "\n", "\n", "\n", - "\n", "\t", ], $str @@ -670,13 +669,11 @@ public static function normalize_whitespace( unset($WHITESPACE_CACHE[$cacheKey]["\xc2\xa0"]); } - $WHITESPACE_CACHE[$cacheKey] = \array_keys($WHITESPACE_CACHE[$cacheKey]); + $WHITESPACE_CACHE[$cacheKey] = array_keys($WHITESPACE_CACHE[$cacheKey]); } if (!$keepBidiUnicodeControls) { - /** - * @var array|null - */ + /** @var array|null */ static $BIDI_UNICODE_CONTROLS_CACHE = null; if ($BIDI_UNICODE_CONTROLS_CACHE === null) { @@ -737,6 +734,32 @@ public static function remove_invisible_characters( return $str; } + /** + * WARNING: This method will return broken characters and is only for special cases. + * + * Convert two UTF-8 encoded string to a single-byte strings suitable for + * functions that need the same string length after the conversion. + * + * The function simply uses (and updates) a tailored dynamic encoding + * (in/out map parameter) where non-ascii characters are remapped to + * the range [128-255] in order of appearance. + * + * @param string $str1 + * @param string $str2 + * + * @return string[] + * + * @phpstan-return array{0: string, 1: string} + */ + public static function to_ascii_remap(string $str1, string $str2): array + { + $charMap = []; + $str1 = self::to_ascii_remap_intern($str1, $charMap); + $str2 = self::to_ascii_remap_intern($str2, $charMap); + + return [$str1, $str2]; + } + /** * Returns an ASCII version of the string. A set of non-ASCII characters are * replaced with their closest ASCII counterparts, and the rest are removed @@ -766,6 +789,8 @@ public static function remove_invisible_characters( * * @return string *

A string that contains only ASCII characters.

+ * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language */ public static function to_ascii( string $str, @@ -779,13 +804,12 @@ public static function to_ascii( return ''; } + /** @phpstan-var ASCII::*_LANGUAGE_CODE - hack for phpstan */ $language = self::get_language($language); static $EXTRA_SYMBOLS_CACHE = null; - /** - * @var array> - */ + /** @var array> */ static $REPLACE_HELPER_CACHE = []; $cacheKey = $language . '-' . $replace_extra_symbols; @@ -807,7 +831,7 @@ public static function to_ascii( $EXTRA_SYMBOLS_CACHE === null ) { $EXTRA_SYMBOLS_CACHE = []; - foreach (self::$ASCII_EXTRAS ?? [] as $extrasLanguageTmp => $extrasDataTmp) { + foreach (self::$ASCII_EXTRAS ?? [] as $extrasDataTmp) { foreach ($extrasDataTmp as $extrasDataKeyTmp => $extrasDataValueTmp) { $EXTRA_SYMBOLS_CACHE[$extrasDataKeyTmp] = $extrasDataKeyTmp; } @@ -933,7 +957,7 @@ public static function to_ascii( } } - foreach ($matches[0] as $keyTmp => $char) { + foreach ($matches[0] as $char) { if ( !isset($charDone[$char]) && @@ -959,7 +983,6 @@ public static function to_ascii( } if ($use_transliterate) { - /** @noinspection ArgumentEqualsDefaultValueInspection */ $str = self::to_transliterate($str, null, false); } @@ -1001,9 +1024,9 @@ public static function to_filename( $str = (string) \preg_replace( [ - '/[^' . $fallback_char_escaped . '.\\-a-zA-Z0-9\\s]/', // 1) remove un-needed chars - '/[\\s]+/u', // 2) convert spaces to $fallback_char - '/[' . $fallback_char_escaped . ']+/u', // 3) remove double $fallback_char's + '/[^' . $fallback_char_escaped . '.\\-a-zA-Z\d\\s]/', // 1) remove un-needed chars + '/\s+/u', // 2) convert spaces to $fallback_char + '/[' . $fallback_char_escaped . ']+/u', // 3) remove double $fallback_char's ], [ '', @@ -1038,6 +1061,8 @@ public static function to_filename( * * @return string *

A string that has been converted to an URL slug.

+ * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language */ public static function to_slugify( string $str, @@ -1118,19 +1143,13 @@ public static function to_transliterate( $unknown = '?', bool $strict = false ): string { - /** - * @var array|null - */ + /** @var array|null */ static $UTF8_TO_TRANSLIT = null; - /** - * null|\Transliterator - */ + /** null|\Transliterator */ static $TRANSLITERATOR = null; - /** - * @var bool|null - */ + /** @var bool|null */ static $SUPPORT_INTL = null; if ($str === '') { @@ -1165,9 +1184,7 @@ public static function to_transliterate( ) { if (!isset($TRANSLITERATOR)) { // INFO: see "*-Latin" rules via "transliterator_list_ids()" - /** - * @var \Transliterator - */ + /** @var \Transliterator */ $TRANSLITERATOR = \transliterator_create('NFKC; [:Nonspacing Mark:] Remove; NFKC; Any-Latin; Latin-ASCII;'); } @@ -1316,6 +1333,50 @@ public static function to_transliterate( return $str_tmp; } + /** + * WARNING: This method will return broken characters and is only for special cases. + * + * Convert a UTF-8 encoded string to a single-byte string suitable for + * functions that need the same string length after the conversion. + * + * The function simply uses (and updates) a tailored dynamic encoding + * (in/out map parameter) where non-ascii characters are remapped to + * the range [128-255] in order of appearance. + * + * Thus, it supports up to 128 different multibyte code points max over + * the whole set of strings sharing this encoding. + * + * Source: https://github.com/KEINOS/mb_levenshtein + * + * @param string $str

UTF-8 string to be converted to extended ASCII.

+ * @param array $map

Internal-Map of code points to ASCII characters.

+ * + * @return string + *

Mapped borken string.

+ * + * @phpstan-param array $map + */ + private static function to_ascii_remap_intern(string $str, array &$map): string + { + // find all utf-8 characters + $matches = []; + if (!\preg_match_all('/[\xC0-\xF7][\x80-\xBF]+/', $str, $matches)) { + return $str; // plain ascii string + } + + // update the encoding map with the characters not already met + $mapCount = \count($map); + foreach ($matches[0] as $mbc) { + if (!isset($map[$mbc])) { + $map[$mbc] = \chr(128 + $mapCount); + ++$mapCount; + } + } + + // finally, remap non-ascii characters + return \strtr($str, $map); + } + /** * Get the language from a string. * diff --git a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php index d51f557..68c3f9d 100644 --- a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php +++ b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php @@ -1060,9 +1060,9 @@ 'Я' => 'Ya', 'я' => 'ya', ], - // Russian - Passport (2013), ICAO + // Russian - GOST 7.79-2000(B) // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 - 'ru__passport_2013' => [ + 'ru__gost_2000_b' => [ 'А' => 'A', 'а' => 'a', 'Б' => 'B', @@ -1075,8 +1075,8 @@ 'д' => 'd', 'Е' => 'E', 'е' => 'e', - 'Ё' => 'E', - 'ё' => 'e', + 'Ё' => 'Yo', + 'ё' => 'yo', 'Ж' => 'Zh', 'ж' => 'zh', 'З' => 'Z', @@ -1107,42 +1107,42 @@ 'у' => 'u', 'Ф' => 'F', 'ф' => 'f', - 'Х' => 'Kh', - 'х' => 'kh', - 'Ц' => 'Ts', - 'ц' => 'ts', + 'Х' => 'X', + 'х' => 'x', + 'Ц' => 'Cz', + 'ц' => 'cz', 'Ч' => 'Ch', 'ч' => 'ch', 'ш' => 'sh', 'Ш' => 'Sh', - 'Щ' => 'Shch', - 'щ' => 'shch', - 'Ъ' => 'Ie', - 'ъ' => 'ie', - 'Ы' => 'Y', - 'ы' => 'y', + 'Щ' => 'Shh', + 'щ' => 'shh', + 'Ъ' => '', + 'ъ' => '', + 'Ы' => 'Y\'', + 'ы' => 'y\'', 'Ь' => '', 'ь' => '', - 'Э' => 'E', - 'э' => 'e', - 'Ю' => 'Iu', - 'ю' => 'iu', - 'Я' => 'Ia', - 'я' => 'ia', - 'І' => '', - 'і' => '', - 'Ѳ' => '', - 'ѳ' => '', - 'Ѣ' => '', - 'ѣ' => '', - 'Ѵ' => '', - 'ѵ' => '', + 'Э' => 'E\'', + 'э' => 'e\'', + 'Ю' => 'Yu', + 'ю' => 'yu', + 'Я' => 'Ya', + 'я' => 'ya', + 'І' => 'I', + 'і' => 'i', + 'Ѳ' => 'Fh', + 'ѳ' => 'fh', + 'Ѣ' => 'Ye', + 'ѣ' => 'ye', + 'Ѵ' => 'Yh', + 'ѵ' => 'yh', 'Є' => '', 'є' => '', 'Ѥ' => '', 'ѥ' => '', - 'Ѕ' => '', - 'ѕ' => '', + 'Ѕ' => 'Js', + 'ѕ' => 'js', 'Ꙋ' => '', 'ꙋ' => '', 'Ѡ' => '', @@ -1162,9 +1162,9 @@ 'Ѱ' => '', 'ѱ' => '', ], - // Russian - GOST 7.79-2000(B) + // Russian - Passport (2013), ICAO // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 - 'ru__gost_2000_b' => [ + 'ru__passport_2013' => [ 'А' => 'A', 'а' => 'a', 'Б' => 'B', @@ -1177,8 +1177,8 @@ 'д' => 'd', 'Е' => 'E', 'е' => 'e', - 'Ё' => 'Yo', - 'ё' => 'yo', + 'Ё' => 'E', + 'ё' => 'e', 'Ж' => 'Zh', 'ж' => 'zh', 'З' => 'Z', @@ -1209,42 +1209,42 @@ 'у' => 'u', 'Ф' => 'F', 'ф' => 'f', - 'Х' => 'X', - 'х' => 'x', - 'Ц' => 'Cz', - 'ц' => 'cz', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', 'Ч' => 'Ch', 'ч' => 'ch', 'ш' => 'sh', 'Ш' => 'Sh', - 'Щ' => 'Shh', - 'щ' => 'shh', - 'Ъ' => '', - 'ъ' => '', - 'Ы' => 'Y\'', - 'ы' => 'y\'', + 'Щ' => 'Shch', + 'щ' => 'shch', + 'Ъ' => 'Ie', + 'ъ' => 'ie', + 'Ы' => 'Y', + 'ы' => 'y', 'Ь' => '', 'ь' => '', - 'Э' => 'E\'', - 'э' => 'e\'', - 'Ю' => 'Yu', - 'ю' => 'yu', - 'Я' => 'Ya', - 'я' => 'ya', - 'І' => 'I', - 'і' => 'i', - 'Ѳ' => 'Fh', - 'ѳ' => 'fh', - 'Ѣ' => 'Ye', - 'ѣ' => 'ye', - 'Ѵ' => 'Yh', - 'ѵ' => 'yh', + 'Э' => 'E', + 'э' => 'e', + 'Ю' => 'Iu', + 'ю' => 'iu', + 'Я' => 'Ia', + 'я' => 'ia', + 'І' => '', + 'і' => '', + 'Ѳ' => '', + 'ѳ' => '', + 'Ѣ' => '', + 'ѣ' => '', + 'Ѵ' => '', + 'ѵ' => '', 'Є' => '', 'є' => '', 'Ѥ' => '', 'ѥ' => '', - 'Ѕ' => 'Js', - 'ѕ' => 'js', + 'Ѕ' => '', + 'ѕ' => '', 'Ꙋ' => '', 'ꙋ' => '', 'Ѡ' => '', @@ -1265,15 +1265,32 @@ 'ѱ' => '', ], // Ukrainian + // -> https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF?lang=en 'uk' => [ + 'Г' => 'H', + 'г' => 'h', + 'Ґ' => 'G', + 'ґ' => 'g', 'Є' => 'Ye', 'є' => 'ye', + 'И' => 'Y', + 'и' => 'y', 'І' => 'I', 'і' => 'i', 'Ї' => 'Yi', 'ї' => 'yi', - 'Ґ' => 'G', - 'ґ' => 'g', + 'Й' => 'Y', + 'й' => 'y', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'Ш' => 'Sh', + 'ш' => 'sh', + 'Щ' => 'Shch', + 'щ' => 'shch', ], // Kazakh 'kk' => [ @@ -1602,10 +1619,10 @@ 'fa' => [ 'ا' => 'a', 'ب' => 'b', - 'پ' => 'b', + 'پ' => 'p', 'ت' => 't', 'ث' => 's', - 'ج' => 'g', + 'ج' => 'j', 'چ' => 'ch', 'ح' => 'h', 'خ' => 'kh', @@ -2555,6 +2572,8 @@ 'j̄' => 'j', 'J̃' => 'J', 'j̃' => 'j', + 'Й' => 'i', + 'й' => 'i', 'ĸ' => 'k', 'Ĺ' => 'L', 'Ľ' => 'L', @@ -2810,6 +2829,8 @@ 'ȳ' => 'y', 'Ỹ' => 'Y', 'ỹ' => 'y', + 'Щ' => 'Shh', + 'щ' => 'shh', 'Ź' => 'Z', 'ź' => 'z', 'Z̀' => 'Z', diff --git a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php index 426d84a..afe31ae 100644 --- a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php +++ b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php @@ -199,8 +199,8 @@ '&' => ' i ', '+' => ' plus ', ], - // Russian - Passport (2013), ICAO - 'ru__passport_2013' => [ + // Russian - GOST 7.79-2000(B) + 'ru__gost_2000_b' => [ '=' => ' ravnyj ', '%' => ' procent ', '∑' => ' summa ', @@ -210,8 +210,8 @@ '&' => ' i ', '+' => ' plus ', ], - // Russian - GOST 7.79-2000(B) - 'ru__gost_2000_b' => [ + // Russian - Passport (2013), ICAO + 'ru__passport_2013' => [ '=' => ' ravnyj ', '%' => ' procent ', '∑' => ' summa ', diff --git a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php index a6345f2..da81ae2 100644 --- a/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php +++ b/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php @@ -31,8 +31,8 @@ 'fi' => 1, 'ka' => 1, 'ru' => 1, - 'ru__passport_2013' => 1, 'ru__gost_2000_b' => 1, + 'ru__passport_2013' => 1, 'uk' => 1, 'kk' => 1, 'cs' => 1, diff --git a/vendor/voku/simple_html_dom/.github/workflows/ci.yml b/vendor/voku/simple_html_dom/.github/workflows/ci.yml index 8606408..05a4ae9 100644 --- a/vendor/voku/simple_html_dom/.github/workflows/ci.yml +++ b/vendor/voku/simple_html_dom/.github/workflows/ci.yml @@ -22,7 +22,8 @@ jobs: 7.2, 7.3, 7.4, - 8.0 + 8.0, + 8.1 ] composer: [basic] timeout-minutes: 10 @@ -88,11 +89,6 @@ jobs: with: files: build/logs/clover.xml - - name: Upload coverage results to Scrutinizer - uses: sudo-bot/action-scrutinizer@latest - with: - cli-args: "--format=php-clover build/logs/clover.xml" - - name: Archive logs artifacts if: ${{ failure() }} uses: actions/upload-artifact@v2 diff --git a/vendor/voku/simple_html_dom/CHANGELOG b/vendor/voku/simple_html_dom/CHANGELOG index fa0b6ea..a7df24a 100644 --- a/vendor/voku/simple_html_dom/CHANGELOG +++ b/vendor/voku/simple_html_dom/CHANGELOG @@ -1,3 +1,11 @@ +[PHP Simple HTML Dom v4.8.x] +0: refactor -> findOne() -> will now return always an "Blank" object if no element was found +1: "SimpleXmlDomNodeInterface" -> fix phpdocs only +2: "*NodeBlank" -> fix return type from "findOne()" +3: "innerhtmlKeep" -> added for modifying html without loosing html-hacks for e.g. svg elements +4: "HtmlDomHelper" -> added "mergeHtmlAttributes()" +5: "HtmlDomParser" -> hack for multiple root elements +6: "AbstractSimpleHtmlDom" -> PHP 8.1 -> try to fix php type errors [PHP Simple HTML Dom v4.7.x] 1: add "findMultiOrFalse()" + "findOneOrFalse()" @@ -27,6 +35,8 @@ 28: fix -> allow CSS and xPath syntax for XmlDomParser 29: use github actions 30: add "previousNonWhitespaceSibling()" +31: add "SimpleHtmlDom->delete()" & "SimpleHtmlDom->getTag()" thanks @marioquartz + add support for "symfony/css-selector": ~6.0 thanks @dora38 [PHP Simple HTML Dom v4.6.x] 1: add an XmlDomParser Class + simple tests diff --git a/vendor/voku/simple_html_dom/README_API.md b/vendor/voku/simple_html_dom/README_API.md index 3cd6d59..426e0d8 100644 --- a/vendor/voku/simple_html_dom/README_API.md +++ b/vendor/voku/simple_html_dom/README_API.md @@ -3,25 +3,25 @@ ### DomParser API -

find -findMulti -findMultiOrFalse -findOne -
findOneOrFalse +

find +findMulti +findMultiOrFalse +findOne +
findOneOrFalse fixHtmlOutput getDocument -getElementByClass -
getElementById -getElementByTagName -getElementsById -getElementsByTagName +getElementByClass +
getElementById +getElementByTagName +getElementsById +getElementsByTagName
html innerHtml innerXml loadHtml
loadHtmlFile save -set_callback +set_callback text
xml
@@ -43,33 +43,37 @@ ### SimpleHtmlDom (single dom element) API

childNodes +delete find findMulti -findMultiOrFalse -
findOne +
findMultiOrFalse +findOne findOneOrFalse firstChild -getAllAttributes -
getAttribute +
getAllAttributes +getAttribute getElementByClass getElementById -getElementByTagName -
getElementsById +
getElementByTagName +getElementsById getElementsByTagName getHtmlDomParser -getIterator -
getNode +
getIterator +getNode +getTag hasAttribute -html +
html innerHtml -
innerXml +innerXml isRemoved -lastChild +
lastChild nextNonWhitespaceSibling -
nextSibling +nextSibling parentNode +
previousNonWhitespaceSibling previousSibling removeAttribute +removeAttributes
setAttribute text val @@ -77,7 +81,7 @@ --- -## find(string $selector, int|null $idx): +## find(string $selector, int|null $idx): mixed Find list of nodes with a CSS selector. @@ -86,11 +90,11 @@ Find list of nodes with a CSS selector. - `int|null $idx` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## findMulti(string $selector): +## findMulti(string $selector): mixed Find nodes with a CSS selector. @@ -98,11 +102,11 @@ Find nodes with a CSS selector. - `string $selector` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## findMultiOrFalse(string $selector): +## findMultiOrFalse(string $selector): mixed Find nodes with a CSS selector or false, if no element is found. @@ -110,11 +114,11 @@ Find nodes with a CSS selector or false, if no element is found. - `string $selector` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## findOne(string $selector): +## findOne(string $selector): static Find one node with a CSS selector. @@ -122,11 +126,11 @@ Find one node with a CSS selector. - `string $selector` **Return:** -- `TODO: __not_detected__` +- `static` -------- -## findOneOrFalse(string $selector): +## findOneOrFalse(string $selector): mixed Find one node with a CSS selector or false, if no element is found. @@ -134,7 +138,7 @@ Find one node with a CSS selector or false, if no element is found. - `string $selector` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- @@ -163,7 +167,7 @@ __nothing__ -------- -## getElementByClass(string $class): +## getElementByClass(string $class): mixed Return elements by ".class". @@ -171,11 +175,11 @@ Return elements by ".class". - `string $class` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## getElementById(string $id): +## getElementById(string $id): mixed Return element by #id. @@ -183,11 +187,11 @@ Return element by #id. - `string $id` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## getElementByTagName(string $name): +## getElementByTagName(string $name): mixed Return element by tag name. @@ -195,11 +199,11 @@ Return element by tag name. - `string $name` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## getElementsById(string $id, int|null $idx): +## getElementsById(string $id, int|null $idx): mixed Returns elements by "#id". @@ -208,11 +212,11 @@ Returns elements by "#id". - `int|null $idx` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- -## getElementsByTagName(string $name, int|null $idx): +## getElementsByTagName(string $name, int|null $idx): mixed Returns elements by tag name. @@ -221,7 +225,7 @@ Returns elements by tag name. - `int|null $idx` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- @@ -299,7 +303,7 @@ Save the html-dom as string. -------- -## set_callback(callable $functionName): +## set_callback(callable $functionName): mixed @@ -307,7 +311,7 @@ Save the html-dom as string. - `callable $functionName` **Return:** -- `TODO: __not_detected__` +- `mixed` -------- @@ -473,6 +477,18 @@ Returns children of node. -------- +## delete(): mixed + +Delete + +**Parameters:** +__nothing__ + +**Return:** +- `mixed` + +-------- + ## find(string $selector, int|null $idx): SimpleHtmlDomInterface|\SimpleHtmlDomInterface[]|\SimpleHtmlDomNodeInterface<\SimpleHtmlDomInterface> Find list of nodes with a CSS selector. @@ -671,6 +687,18 @@ __nothing__ -------- +## getTag(): string + +Return the tag of node + +**Parameters:** +__nothing__ + +**Return:** +- `string` + +-------- + ## hasAttribute(string $name): bool Determine if an attribute exists on the element. @@ -747,7 +775,7 @@ __nothing__ ## nextNonWhitespaceSibling(): SimpleHtmlDomInterface|null -Returns the next sibling of node and it will ignore whitespace elements. +Returns the next sibling of node, and it will ignore whitespace elements. **Parameters:** __nothing__ @@ -781,6 +809,18 @@ __nothing__ -------- +## previousNonWhitespaceSibling(): SimpleHtmlDomInterface|null + +Returns the previous sibling of node, and it will ignore whitespace elements. + +**Parameters:** +__nothing__ + +**Return:** +- `\SimpleHtmlDomInterface|null` + +-------- + ## previousSibling(): SimpleHtmlDomInterface|null Returns the previous sibling of node. @@ -805,6 +845,18 @@ Remove attribute. -------- +## removeAttributes(): SimpleHtmlDomInterface + +Remove all attributes + +**Parameters:** +__nothing__ + +**Return:** +- `\SimpleHtmlDomInterface` + +-------- + ## setAttribute(string $name, string|null $value, bool $strictEmptyValueCheck): SimpleHtmlDomInterface Set attribute value. diff --git a/vendor/voku/simple_html_dom/composer.json b/vendor/voku/simple_html_dom/composer.json index c92372e..4ef1a9e 100644 --- a/vendor/voku/simple_html_dom/composer.json +++ b/vendor/voku/simple_html_dom/composer.json @@ -24,7 +24,7 @@ ], "require": { "php": ">=7.0.0", - "symfony/css-selector": "~3.0 || ~4.0 || ~5.0", + "symfony/css-selector": "~3.0 || ~4.0 || ~5.0 || ~6.0", "ext-dom": "*", "ext-libxml": "*", "ext-simplexml": "*" diff --git a/vendor/voku/simple_html_dom/src/voku/helper/AbstractDomParser.php b/vendor/voku/simple_html_dom/src/voku/helper/AbstractDomParser.php index 4c06c46..8dfd72c 100644 --- a/vendor/voku/simple_html_dom/src/voku/helper/AbstractDomParser.php +++ b/vendor/voku/simple_html_dom/src/voku/helper/AbstractDomParser.php @@ -109,8 +109,6 @@ public function __clone() $this->document = clone $this->document; } - /** @noinspection MagicMethodsValidityInspection */ - /** * @param string $name * @@ -243,19 +241,21 @@ public function getDocument(): \DOMDocument * Get dom node's outer html. * * @param bool $multiDecodeNewHtmlEntity + * @param bool $putBrokenReplacedBack * * @return string */ - abstract public function html(bool $multiDecodeNewHtmlEntity = false): string; + abstract public function html(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string; /** * Get dom node's inner html. * * @param bool $multiDecodeNewHtmlEntity + * @param bool $putBrokenReplacedBack * * @return string */ - public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string + public function innerHtml(bool $multiDecodeNewHtmlEntity = false, bool $putBrokenReplacedBack = true): string { // init $text = ''; @@ -266,7 +266,7 @@ public function innerHtml(bool $multiDecodeNewHtmlEntity = false): string } } - return $this->fixHtmlOutput($text, $multiDecodeNewHtmlEntity); + return $this->fixHtmlOutput($text, $multiDecodeNewHtmlEntity, $putBrokenReplacedBack); } /** @@ -410,7 +410,7 @@ protected function html5FallbackForScriptTags(string &$html) { // regEx for e.g.: [