From c9efafa5a45c16fb067f4eb43477ccc6bed24a67 Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 5 Jul 2022 17:23:28 +0300 Subject: [PATCH] feat(core): move all Flextype helpers into `Flextype` namespace --- .../core/Cache/Drivers/Phparray/Driver.php | 1 + .../core/Console/Commands/AboutCommand.php | 1 + .../Commands/Cache/CacheDeleteCommand.php | 1 + .../Cache/CacheDeleteMultipleCommand.php | 2 ++ .../Commands/Cache/CacheGetCommand.php | 1 + .../Cache/CacheGetMultipleCommand.php | 2 ++ .../Commands/Cache/CacheHasCommand.php | 1 + .../Commands/Cache/CacheSetCommand.php | 1 + .../Cache/CacheSetMultipleCommand.php | 2 ++ .../Commands/Entries/EntriesCopyCommand.php | 1 + .../Commands/Entries/EntriesCreateCommand.php | 2 ++ .../Commands/Entries/EntriesDeleteCommand.php | 1 + .../Commands/Entries/EntriesFetchCommand.php | 3 ++ .../Commands/Entries/EntriesHasCommand.php | 1 + .../Commands/Entries/EntriesMoveCommand.php | 1 + .../Commands/Entries/EntriesUpdateCommand.php | 2 ++ .../Commands/Tokens/TokensCreateCommand.php | 5 ++++ .../Commands/Tokens/TokensDeleteCommand.php | 1 + .../Commands/Tokens/TokensFetchCommand.php | 3 ++ .../Commands/Tokens/TokensGenerateCommand.php | 1 + .../Tokens/TokensGenerateHashCommand.php | 2 ++ .../Commands/Tokens/TokensHasCommand.php | 1 + .../Commands/Tokens/TokensUpdateCommand.php | 2 ++ .../Tokens/TokensVerifyHashCommand.php | 1 + src/flextype/core/Console/FlextypeConsole.php | 1 + src/flextype/core/Endpoints/Api.php | 6 ++-- src/flextype/core/Endpoints/Entries.php | 2 +- src/flextype/core/Endpoints/Registry.php | 2 +- src/flextype/core/Endpoints/Tokens.php | 4 +++ .../Directives/ExpressionsDirective.php | 4 +++ .../Entries/Directives/MarkdownDirective.php | 4 +++ .../core/Entries/Directives/PhpDirective.php | 3 ++ .../Directives/ShortcodesDirective.php | 4 +++ .../Entries/Directives/TextileDirective.php | 4 +++ .../Entries/Directives/TypesDirective.php | 6 ++++ src/flextype/core/Entries/Entries.php | 14 +++++---- .../Entries/Expressions/ActionsExpression.php | 3 +- .../Expressions/CollectionExpression.php | 18 +++++++---- .../Entries/Expressions/CsrfExpression.php | 1 + .../Entries/Expressions/EntriesExpression.php | 1 + .../Entries/Expressions/FieldExpression.php | 3 +- .../Entries/Expressions/I18nExpression.php | 5 ++-- .../Entries/Expressions/ParsersExpression.php | 3 +- .../Expressions/RegistryExpression.php | 3 +- .../Expressions/SerializersExpression.php | 3 +- .../Entries/Expressions/SlugifyExpression.php | 3 +- .../Entries/Expressions/StringsExpression.php | 2 +- .../Entries/Expressions/UrlExpression.php | 30 ++++++++++++------- .../Entries/Expressions/VarExpression.php | 3 +- .../Entries/Fields/Default/CreatedAtField.php | 3 ++ .../Entries/Fields/Default/CreatedByField.php | 2 ++ .../core/Entries/Fields/Default/IdField.php | 2 ++ .../Fields/Default/ModifiedAtField.php | 2 ++ .../Fields/Default/PublishedAtField.php | 3 ++ .../Fields/Default/PublishedByField.php | 2 ++ .../Entries/Fields/Default/RoutableField.php | 2 ++ .../core/Entries/Fields/Default/SlugField.php | 2 ++ .../core/Entries/Fields/Default/UuidField.php | 2 ++ .../Fields/Default/VisibilityField.php | 2 ++ .../Fields/Tokens/Items/CallsField.php | 2 ++ .../Entries/Fields/Tokens/Items/IdField.php | 2 ++ .../Fields/Tokens/Items/LimitCallsField.php | 2 ++ .../Fields/Tokens/Items/StateField.php | 2 ++ .../core/Entries/Macros/EntriesMacros.php | 5 +++- .../core/Entries/Macros/PhpMacros.php | 4 ++- .../core/Entries/Macros/RegistryMacros.php | 5 +++- .../core/Middlewares/CsrfMiddleware.php | 1 + src/flextype/core/Parsers/Markdown.php | 4 +-- src/flextype/core/Parsers/Shortcodes.php | 4 +-- .../core/Parsers/Shortcodes/CalcShortcode.php | 5 ++-- .../Parsers/Shortcodes/ConstShortcode.php | 3 +- .../Parsers/Shortcodes/EntriesShortcode.php | 8 +++-- .../core/Parsers/Shortcodes/EvalShortcode.php | 5 ++-- .../Parsers/Shortcodes/FieldShortcode.php | 4 ++- .../Shortcodes/FilesystemShortcode.php | 3 ++ .../core/Parsers/Shortcodes/I18nShortcode.php | 6 ++-- .../core/Parsers/Shortcodes/IfShortcode.php | 5 ++-- .../Parsers/Shortcodes/MarkdownShortcode.php | 3 +- .../core/Parsers/Shortcodes/PhpShortcode.php | 2 ++ .../core/Parsers/Shortcodes/RawShortcode.php | 3 +- .../Parsers/Shortcodes/RegistryShortcode.php | 6 ++-- .../Parsers/Shortcodes/StringsShortcode.php | 5 ++-- .../Parsers/Shortcodes/TextileShortcode.php | 3 +- .../core/Parsers/Shortcodes/TypeShortcode.php | 3 +- .../Parsers/Shortcodes/UnlessShortcode.php | 5 ++-- .../core/Parsers/Shortcodes/UrlShortcode.php | 14 +++++++-- .../core/Parsers/Shortcodes/UuidShortcode.php | 4 +-- .../core/Parsers/Shortcodes/VarShortcode.php | 4 ++- .../core/Parsers/Shortcodes/WhenShortcode.php | 5 ++-- src/flextype/core/Parsers/Textile.php | 4 +-- src/flextype/core/Plugins.php | 1 - src/flextype/core/Serializers/Frontmatter.php | 7 +++-- src/flextype/core/Serializers/Json.php | 4 +-- src/flextype/core/Serializers/Json5.php | 4 +-- src/flextype/core/Serializers/Neon.php | 4 +-- src/flextype/core/Serializers/PhpArray.php | 4 +-- src/flextype/core/Serializers/Yaml.php | 4 +-- src/flextype/flextype.php | 14 ++++----- src/flextype/helpers/collection.php | 2 ++ src/flextype/helpers/finder.php | 3 +- src/flextype/helpers/helpers.php | 2 ++ src/flextype/helpers/i18n.php | 2 ++ src/flextype/helpers/image.php | 3 ++ src/flextype/helpers/services.php | 2 ++ src/flextype/helpers/tokens.php | 2 ++ src/flextype/helpers/upload.php | 3 ++ src/flextype/helpers/url.php | 2 ++ src/flextype/macros/collection.php | 3 ++ src/flextype/macros/macros.php | 2 ++ src/flextype/routes/endpoints/cache.php | 2 +- src/flextype/routes/endpoints/entries.php | 2 +- src/flextype/routes/endpoints/registry.php | 2 +- src/flextype/routes/endpoints/tokens.php | 2 +- src/flextype/routes/routes.php | 2 ++ .../entries/blog-php-macros/entry.yaml | 6 ++-- tests/src/flextype/HelpersTest.php | 18 +++++++++++ tests/src/flextype/core/ActionsTest.php | 1 + .../Directives/ExpressionsDirectiveTest.php | 2 ++ .../Directives/MarkdownDirectiveTest.php | 2 ++ .../Entries/Directives/PhpDirectiveTest.php | 2 ++ .../Directives/ShortcodesDirectiveTest.php | 2 ++ .../Directives/TextileDirectiveTest.php | 2 ++ .../Entries/Directives/TypesDirectiveTest.php | 2 ++ .../src/flextype/core/Entries/EntriesTest.php | 2 ++ .../Expressions/ActionsExpressionTest.php | 2 ++ .../Expressions/CollectionExpressionTest.php | 1 + .../Expressions/ConstExpressionTest.php | 1 + .../Expressions/CsrfExpressionTest.php | 1 + .../Expressions/EntriesExpressionTest.php | 1 + .../Expressions/FieldExpressionTest.php | 1 + .../Expressions/FilesystemExpressionTest.php | 1 + .../Expressions/I18nExpressionTest.php | 1 + .../Expressions/ParsersExpressionTest.php | 1 + .../Expressions/RegistryExpressionTest.php | 2 ++ .../Expressions/SerializersExpressionTest.php | 1 + .../Expressions/SlugifyExpressionTest.php | 1 + .../Expressions/StringsExpressionTest.php | 1 + .../Entries/Expressions/VarExpressionTest.php | 1 + .../Entries/Fields/CreatedAtFieldTest.php | 1 + .../Entries/Fields/CreatedByFieldTest.php | 1 + .../core/Entries/Fields/IdFieldTest.php | 1 + .../Entries/Fields/ModifiedAtFieldTest.php | 1 + .../Entries/Fields/PublishedAtFieldTest.php | 1 + .../Entries/Fields/PublishedByFieldTest.php | 1 + .../core/Entries/Fields/RoutableFieldTest.php | 2 ++ .../core/Entries/Fields/SlugFieldTest.php | 1 + .../core/Entries/Fields/UuidFieldTest.php | 1 + .../Entries/Fields/VisibilityFieldTest.php | 1 + .../core/Entries/Macros/EntriesMacrosTest.php | 3 ++ .../core/Entries/Macros/PhpMacrosTest.php | 2 ++ .../Entries/Macros/RegistryMacrosTest.php | 2 ++ .../flextype/core/Parsers/MarkdownTest.php | 2 ++ .../Parsers/Shortcodes/CalcShortcodeTest.php | 2 ++ .../Parsers/Shortcodes/ConstShortcodeTest.php | 2 ++ .../Shortcodes/EntriesShortcodeTest.php | 2 ++ .../Parsers/Shortcodes/EvalShortcodeTest.php | 2 ++ .../Parsers/Shortcodes/FieldShortcodeTest.php | 2 ++ .../Shortcodes/FilesystemShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/I18nShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/IfShortcodeTest.php | 3 ++ .../Shortcodes/MarkdownShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/PhpShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/RawShortcodeTest.php | 3 ++ .../Shortcodes/RegistryShortcodeTest.php | 3 ++ .../Shortcodes/StringsShortcodeTest.php | 2 ++ .../Shortcodes/TextileShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/TypeShortcodeTest.php | 3 ++ .../Shortcodes/UnlessShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/UrlShortcodeTest.php | 4 +++ .../Parsers/Shortcodes/UuidShortcodeTest.php | 2 ++ .../Parsers/Shortcodes/VarShortcodeTest.php | 3 ++ .../Parsers/Shortcodes/WhenShortcodeTest.php | 3 ++ .../flextype/core/Parsers/ShortcodesTest.php | 2 ++ .../src/flextype/core/Parsers/TextileTest.php | 2 ++ tests/src/flextype/core/PluginsTest.php | 2 ++ .../core/Serializers/FrontmatterTest.php | 1 + .../flextype/core/Serializers/Json5Test.php | 2 ++ .../flextype/core/Serializers/JsonTest.php | 2 ++ .../flextype/core/Serializers/NeonTest.php | 2 ++ .../core/Serializers/PhpArrayTest.php | 2 ++ .../flextype/core/Serializers/YamlTest.php | 2 ++ tests/src/flextype/helpers/CollectionTest.php | 5 ++++ tests/src/flextype/macros/CollectionTest.php | 2 ++ 183 files changed, 450 insertions(+), 105 deletions(-) diff --git a/src/flextype/core/Cache/Drivers/Phparray/Driver.php b/src/flextype/core/Cache/Drivers/Phparray/Driver.php index ee22ba93..38aef0d1 100644 --- a/src/flextype/core/Cache/Drivers/Phparray/Driver.php +++ b/src/flextype/core/Cache/Drivers/Phparray/Driver.php @@ -26,6 +26,7 @@ use Phpfastcache\Exceptions\PhpfastcacheInvalidArgumentException; use Phpfastcache\Exceptions\PhpfastcacheIOException; use Phpfastcache\Exceptions\PhpfastcacheLogicException; use Phpfastcache\Util\Directory; +use function Flextype\serializers; /** * @method Config getConfig() diff --git a/src/flextype/core/Console/Commands/AboutCommand.php b/src/flextype/core/Console/Commands/AboutCommand.php index 2bc7232e..e8447b42 100644 --- a/src/flextype/core/Console/Commands/AboutCommand.php +++ b/src/flextype/core/Console/Commands/AboutCommand.php @@ -26,6 +26,7 @@ use function Thermage\div; use function Thermage\span; use function Thermage\hr; use function Thermage\renderToString; +use function Flextype\registry; class AboutCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheDeleteCommand.php b/src/flextype/core/Console/Commands/Cache/CacheDeleteCommand.php index 2dba9b14..a2a3b8fe 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheDeleteCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheDeleteCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\cache; class CacheDeleteCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheDeleteMultipleCommand.php b/src/flextype/core/Console/Commands/Cache/CacheDeleteMultipleCommand.php index 66c7ea9f..f8694fd7 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheDeleteMultipleCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheDeleteMultipleCommand.php @@ -22,6 +22,8 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\collectionFromString; +use function Flextype\cache; class CacheDeleteMultipleCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheGetCommand.php b/src/flextype/core/Console/Commands/Cache/CacheGetCommand.php index a1257256..891b7c7d 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheGetCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheGetCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\cache; class CacheGetCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheGetMultipleCommand.php b/src/flextype/core/Console/Commands/Cache/CacheGetMultipleCommand.php index 98b3b466..bce99150 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheGetMultipleCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheGetMultipleCommand.php @@ -23,6 +23,8 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\cache; +use function Flextype\collectionFromString; class CacheGetMultipleCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheHasCommand.php b/src/flextype/core/Console/Commands/Cache/CacheHasCommand.php index 82ddd071..ddf6ee37 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheHasCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheHasCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\cache; class CacheHasCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheSetCommand.php b/src/flextype/core/Console/Commands/Cache/CacheSetCommand.php index 2e5e51f5..a3da44be 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheSetCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheSetCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\cache; class CacheSetCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php b/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php index 03775acf..d5cf174e 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php @@ -23,6 +23,8 @@ use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\serializers; +use function Flextype\cache; class CacheSetMultipleCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesCopyCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesCopyCommand.php index e1f3af58..db25a930 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesCopyCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesCopyCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\entries; class EntriesCopyCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php index d8cf9bc3..f1c2ad00 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php @@ -23,6 +23,8 @@ use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\entries; +use function Flextype\serializers; class EntriesCreateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesDeleteCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesDeleteCommand.php index 3bdcb053..0ca3f185 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesDeleteCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesDeleteCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\entries; class EntriesDeleteCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php index 3340c75c..6cca801c 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php @@ -27,6 +27,9 @@ use function Thermage\div; use function Thermage\span; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\entries; +use function Flextype\serializers; +use function Flextype\collection; class EntriesFetchCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesHasCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesHasCommand.php index 50457b8b..cd4bae5f 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesHasCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesHasCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\entries; class EntriesHasCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesMoveCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesMoveCommand.php index 82c65ccc..46148eb5 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesMoveCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesMoveCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\entries; class EntriesMoveCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php index 09da285f..ab116f77 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php @@ -23,6 +23,8 @@ use Symfony\Component\Console\Output\OutputInterface; use function Thermage\div; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\entries; +use function Flextype\serializers; class EntriesUpdateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensCreateCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensCreateCommand.php index 93eb2db7..6d5bd3df 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensCreateCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensCreateCommand.php @@ -23,6 +23,11 @@ use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\generateToken; +use function Flextype\serializers; +use function Flextype\entries; +use function Flextype\generateTokenHash; + class TokensCreateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensDeleteCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensDeleteCommand.php index 936add45..f28d49ab 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensDeleteCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensDeleteCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\entries; class TokensDeleteCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php index 6736281d..6eed8000 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php @@ -27,6 +27,9 @@ use function Thermage\div; use function Thermage\span; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\serializers; +use function Flextype\entries; +use function Flextype\collection; class TokensFetchCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensGenerateCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensGenerateCommand.php index f48399ca..0658e474 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensGenerateCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensGenerateCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\generateToken; class TokensGenerateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensGenerateHashCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensGenerateHashCommand.php index fa3928b9..7eb2aa24 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensGenerateHashCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensGenerateHashCommand.php @@ -22,6 +22,8 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\generateToken; +use function Flextype\generateTokenHash; class TokensGenerateHashCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensHasCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensHasCommand.php index e9fed6a8..fe232066 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensHasCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensHasCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\entries; class TokensHasCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php index 2bcd495e..2afc7a7c 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php @@ -23,6 +23,8 @@ use Symfony\Component\Console\Output\OutputInterface; use function Thermage\div; use function Thermage\renderToString; use function Glowy\Strings\strings; +use function Flextype\serializers; +use function Flextype\entries; class TokensUpdateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensVerifyHashCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensVerifyHashCommand.php index 80bc0901..a756f71b 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensVerifyHashCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensVerifyHashCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Style\SymfonyStyle; use function Thermage\div; use function Thermage\renderToString; +use function Flextype\verifyTokenHash; class TokensVerifyHashCommand extends Command { diff --git a/src/flextype/core/Console/FlextypeConsole.php b/src/flextype/core/Console/FlextypeConsole.php index be2048b8..d52df386 100644 --- a/src/flextype/core/Console/FlextypeConsole.php +++ b/src/flextype/core/Console/FlextypeConsole.php @@ -48,6 +48,7 @@ use Flextype\Console\Commands\Tokens\TokensMoveCommand; use Flextype\Console\Commands\Tokens\TokensHasCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use function Flextype\console; class FlextypeConsole extends ConsoleApplication { diff --git a/src/flextype/core/Endpoints/Api.php b/src/flextype/core/Endpoints/Api.php index 1cdceb49..8b0fa94b 100644 --- a/src/flextype/core/Endpoints/Api.php +++ b/src/flextype/core/Endpoints/Api.php @@ -24,8 +24,10 @@ use function count; use function in_array; use function is_string; use function password_verify; -use function registry; -use function serializers; +use function Flextype\serializers; +use function Flextype\verifyTokenHash; +use function Flextype\registry; +use function Flextype\entries; class Api { diff --git a/src/flextype/core/Endpoints/Entries.php b/src/flextype/core/Endpoints/Entries.php index 6f40ed8a..e6687c41 100644 --- a/src/flextype/core/Endpoints/Entries.php +++ b/src/flextype/core/Endpoints/Entries.php @@ -19,7 +19,7 @@ namespace Flextype\Endpoints; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; -use function entries; +use function Flextype\entries; use function count; class Entries extends Api diff --git a/src/flextype/core/Endpoints/Registry.php b/src/flextype/core/Endpoints/Registry.php index 4884456f..1bd0fb66 100644 --- a/src/flextype/core/Endpoints/Registry.php +++ b/src/flextype/core/Endpoints/Registry.php @@ -20,7 +20,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use function count; -use function registry; +use function Flextype\registry; class Registry extends Api { diff --git a/src/flextype/core/Endpoints/Tokens.php b/src/flextype/core/Endpoints/Tokens.php index 58d48686..c7148532 100644 --- a/src/flextype/core/Endpoints/Tokens.php +++ b/src/flextype/core/Endpoints/Tokens.php @@ -21,6 +21,10 @@ use Psr\Http\Message\ServerRequestInterface; use function count; use function Glowy\Filesystem\filesystem; +use function Flextype\generateToken; +use function Flextype\generateTokenHash; +use function Flextype\verifyTokenHash; +use function Flextype\entries; class Tokens extends Api { diff --git a/src/flextype/core/Entries/Directives/ExpressionsDirective.php b/src/flextype/core/Entries/Directives/ExpressionsDirective.php index 0938009a..0fc73f2a 100644 --- a/src/flextype/core/Entries/Directives/ExpressionsDirective.php +++ b/src/flextype/core/Entries/Directives/ExpressionsDirective.php @@ -15,6 +15,10 @@ declare(strict_types=1); */ use Glowy\Arrays\Arrays as Collection; +use function Flextype\emitter; +use function Flextype\registry; +use function Flextype\entries; +use function Flextype\expression; // Directive: [[ ]] emitter()->addListener('onEntriesFetchSingleField', static function (): void { diff --git a/src/flextype/core/Entries/Directives/MarkdownDirective.php b/src/flextype/core/Entries/Directives/MarkdownDirective.php index 447e4ace..cb480816 100644 --- a/src/flextype/core/Entries/Directives/MarkdownDirective.php +++ b/src/flextype/core/Entries/Directives/MarkdownDirective.php @@ -16,6 +16,10 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\registry; +use function Flextype\entries; +use function Flextype\parsers; // Directive: @markdown emitter()->addListener('onEntriesFetchSingleField', static function (): void { diff --git a/src/flextype/core/Entries/Directives/PhpDirective.php b/src/flextype/core/Entries/Directives/PhpDirective.php index 41a6eeb3..51711901 100644 --- a/src/flextype/core/Entries/Directives/PhpDirective.php +++ b/src/flextype/core/Entries/Directives/PhpDirective.php @@ -16,6 +16,9 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; +use function Flextype\registry; // Directive: @php emitter()->addListener('onEntriesFetchSingleField', static function (): void { diff --git a/src/flextype/core/Entries/Directives/ShortcodesDirective.php b/src/flextype/core/Entries/Directives/ShortcodesDirective.php index 9b874d06..5c1e10fa 100644 --- a/src/flextype/core/Entries/Directives/ShortcodesDirective.php +++ b/src/flextype/core/Entries/Directives/ShortcodesDirective.php @@ -16,6 +16,10 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\registry; +use function Flextype\entries; +use function Flextype\parsers; // Directive: @shortcodes emitter()->addListener('onEntriesFetchSingleField', static function (): void { diff --git a/src/flextype/core/Entries/Directives/TextileDirective.php b/src/flextype/core/Entries/Directives/TextileDirective.php index 1122cc81..b911d136 100644 --- a/src/flextype/core/Entries/Directives/TextileDirective.php +++ b/src/flextype/core/Entries/Directives/TextileDirective.php @@ -16,6 +16,10 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\registry; +use function Flextype\parsers; +use function Flextype\entries; // Directive: @textile emitter()->addListener('onEntriesFetchSingleField', static function (): void { diff --git a/src/flextype/core/Entries/Directives/TypesDirective.php b/src/flextype/core/Entries/Directives/TypesDirective.php index 861a5356..f9565c22 100644 --- a/src/flextype/core/Entries/Directives/TypesDirective.php +++ b/src/flextype/core/Entries/Directives/TypesDirective.php @@ -16,6 +16,12 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\serializers; +use function Flextype\collectionFromQueryString; +use function Flextype\collection; // Directive: @type[] emitter()->addListener('onEntriesFetchSingleField', static function (): void { diff --git a/src/flextype/core/Entries/Entries.php b/src/flextype/core/Entries/Entries.php index 4c538756..1f7ee3fd 100755 --- a/src/flextype/core/Entries/Entries.php +++ b/src/flextype/core/Entries/Entries.php @@ -21,17 +21,19 @@ use Glowy\Macroable\Macroable; use function array_merge; use function Glowy\Arrays\arrays; -use function cache; +use function Flextype\cache; use function count; -use function emitter; +use function Flextype\emitter; use function file_exists; use function Glowy\Filesystem\filesystem; -use function filterCollection; -use function find; +use function Flextype\find; use function is_array; -use function Glowy\Registry\registry; -use function serializers; +use function Flextype\registry; +use function Flextype\serializers; use function Glowy\Strings\strings; +use function Flextype\filterCollection; +use function Flextype\collection; +use function Flextype\expression; class Entries { diff --git a/src/flextype/core/Entries/Expressions/ActionsExpression.php b/src/flextype/core/Entries/Expressions/ActionsExpression.php index ac7c4d12..ceb20a68 100644 --- a/src/flextype/core/Entries/Expressions/ActionsExpression.php +++ b/src/flextype/core/Entries/Expressions/ActionsExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\actions; class ActionsExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('actions', fn() => 'actions()', fn($arguments) => actions()) + new ExpressionFunction('actions', fn() => '\Flextype\actions()', fn($arguments) => actions()) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/CollectionExpression.php b/src/flextype/core/Entries/Expressions/CollectionExpression.php index 0a4b81cd..b8f3b731 100644 --- a/src/flextype/core/Entries/Expressions/CollectionExpression.php +++ b/src/flextype/core/Entries/Expressions/CollectionExpression.php @@ -18,18 +18,24 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\collection; +use function Flextype\collectionFromJson; +use function Flextype\collectionFromString; +use function Flextype\collectionWithRange; +use function Flextype\collectionFromQueryString; +use function Flextype\filterCollection; class CollectionExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('collection', fn($items = null) => 'collection($items)', fn($arguments, $items = null) => collection($items)), - new ExpressionFunction('collectionFromJson', fn(string $input, bool $assoc = true, int $depth = 512, int $flags = 0) => 'collectionFromJson($input, $assoc, $depth, $flags)', fn($arguments, string $input, bool $assoc = true, int $depth = 512, int $flags = 0) => collectionFromJson($input, $assoc, $depth, $flags)), - new ExpressionFunction('collectionFromString', fn(string $string, string $separator) => 'collectionFromString($string, $separator)', fn($arguments, string $string, string $separator) => collectionFromString($string, $separator)), - new ExpressionFunction('collectionWithRange', fn($low, $high, int $step = 1) => 'collectionWithRange($low, $high, $step)', fn($arguments, $low, $high, int $step = 1) => collectionWithRange($low, $high, $step)), - new ExpressionFunction('collectionFromQueryString', fn(string $string) => 'collectionFromQueryString($string)', fn($arguments, string $string) => collectionFromQueryString($string)), - new ExpressionFunction('filterCollection', fn($items = [], array $options = []) => 'filterCollection($items, $options)', fn($arguments, $items = [], array $options = []) => filterCollection($items, $options)), + new ExpressionFunction('collection', fn($items = null) => '\Flextype\collection($items)', fn($arguments, $items = null) => collection($items)), + new ExpressionFunction('collectionFromJson', fn(string $input, bool $assoc = true, int $depth = 512, int $flags = 0) => '\Flextype\ccollectionFromJson($input, $assoc, $depth, $flags)', fn($arguments, string $input, bool $assoc = true, int $depth = 512, int $flags = 0) => collectionFromJson($input, $assoc, $depth, $flags)), + new ExpressionFunction('collectionFromString', fn(string $string, string $separator) => '\Flextype\ccollectionFromString($string, $separator)', fn($arguments, string $string, string $separator) => collectionFromString($string, $separator)), + new ExpressionFunction('collectionWithRange', fn($low, $high, int $step = 1) => '\Flextype\ccollectionWithRange($low, $high, $step)', fn($arguments, $low, $high, int $step = 1) => collectionWithRange($low, $high, $step)), + new ExpressionFunction('collectionFromQueryString', fn(string $string) => '\Flextype\ccollectionFromQueryString($string)', fn($arguments, string $string) => collectionFromQueryString($string)), + new ExpressionFunction('filterCollection', fn($items = [], array $options = []) => '\Flextype\cfilterCollection($items, $options)', fn($arguments, $items = [], array $options = []) => filterCollection($items, $options)), ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/CsrfExpression.php b/src/flextype/core/Entries/Expressions/CsrfExpression.php index d7e6f522..0c0c9e8e 100644 --- a/src/flextype/core/Entries/Expressions/CsrfExpression.php +++ b/src/flextype/core/Entries/Expressions/CsrfExpression.php @@ -18,6 +18,7 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\csrf; class CsrfExpression implements ExpressionFunctionProviderInterface { diff --git a/src/flextype/core/Entries/Expressions/EntriesExpression.php b/src/flextype/core/Entries/Expressions/EntriesExpression.php index 4defdb3c..c736ac25 100644 --- a/src/flextype/core/Entries/Expressions/EntriesExpression.php +++ b/src/flextype/core/Entries/Expressions/EntriesExpression.php @@ -20,6 +20,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; use Glowy\Arrays\Arrays as Collection; use Glowy\Macroable\Macroable; +use function Flextype\entries; class EntriesExpression implements ExpressionFunctionProviderInterface { diff --git a/src/flextype/core/Entries/Expressions/FieldExpression.php b/src/flextype/core/Entries/Expressions/FieldExpression.php index 06550ca0..d40c45d3 100644 --- a/src/flextype/core/Entries/Expressions/FieldExpression.php +++ b/src/flextype/core/Entries/Expressions/FieldExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\entries; class FieldExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('field', fn(string $field) => "entries()->registry()->get('methods.fetch.result.' . $field . ')'", fn($arguments, string $field) => entries()->registry()->get('methods.fetch.result.' . $field)) + new ExpressionFunction('field', fn(string $field) => "\Flextype\entries()->registry()->get('methods.fetch.result.' . $field . ')'", fn($arguments, string $field) => entries()->registry()->get('methods.fetch.result.' . $field)) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/I18nExpression.php b/src/flextype/core/Entries/Expressions/I18nExpression.php index ae996b2b..3a7394fb 100644 --- a/src/flextype/core/Entries/Expressions/I18nExpression.php +++ b/src/flextype/core/Entries/Expressions/I18nExpression.php @@ -18,14 +18,15 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\__; class I18nExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('tr', fn(string $translate, array $values = [], string $locale = null) => '__($translate, $values, $locale)', fn($arguments, string $translate, array $values = [], string $locale = null) => __($translate, $values, $locale)), - new ExpressionFunction('__', fn(string $translate, array $values = [], string $locale = null) => '__($translate, $values, $locale)', fn($arguments, string $translate, array $values = [], string $locale = null) => __($translate, $values, $locale)), + new ExpressionFunction('tr', fn(string $translate, array $values = [], string $locale = null) => '\Flextype\__($translate, $values, $locale)', fn($arguments, string $translate, array $values = [], string $locale = null) => __($translate, $values, $locale)), + new ExpressionFunction('__', fn(string $translate, array $values = [], string $locale = null) => '\Flextype\__($translate, $values, $locale)', fn($arguments, string $translate, array $values = [], string $locale = null) => __($translate, $values, $locale)), ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/ParsersExpression.php b/src/flextype/core/Entries/Expressions/ParsersExpression.php index 0aafb32c..97b27d55 100644 --- a/src/flextype/core/Entries/Expressions/ParsersExpression.php +++ b/src/flextype/core/Entries/Expressions/ParsersExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\parsers; class ParsersExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('parsers', fn() => 'parsers()', fn($arguments) => parsers()) + new ExpressionFunction('parsers', fn() => '\Flextype\parsers()', fn($arguments) => parsers()) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/RegistryExpression.php b/src/flextype/core/Entries/Expressions/RegistryExpression.php index 7e85160c..93f315ed 100644 --- a/src/flextype/core/Entries/Expressions/RegistryExpression.php +++ b/src/flextype/core/Entries/Expressions/RegistryExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\registry; class RegistryExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('registry', fn() => 'registry()', fn($arguments) => registry()) + new ExpressionFunction('registry', fn() => '\Flextype\registry()', fn($arguments) => registry()) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/SerializersExpression.php b/src/flextype/core/Entries/Expressions/SerializersExpression.php index 2725c9e3..23438fbd 100644 --- a/src/flextype/core/Entries/Expressions/SerializersExpression.php +++ b/src/flextype/core/Entries/Expressions/SerializersExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\serializers; class SerializersExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('serializers', fn() => 'serializers()', fn($arguments) => serializers()) + new ExpressionFunction('serializers', fn() => '\Flextype\serializers()', fn($arguments) => serializers()) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/SlugifyExpression.php b/src/flextype/core/Entries/Expressions/SlugifyExpression.php index ad9cc04b..d338a0ae 100644 --- a/src/flextype/core/Entries/Expressions/SlugifyExpression.php +++ b/src/flextype/core/Entries/Expressions/SlugifyExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\slugify; class SlugifyExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('slugify', fn() => 'slugify()', fn($arguments) => slugify()) + new ExpressionFunction('slugify', fn() => '\Flextype\slugify()', fn($arguments) => slugify()) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/StringsExpression.php b/src/flextype/core/Entries/Expressions/StringsExpression.php index d14db4d6..7b32d08c 100644 --- a/src/flextype/core/Entries/Expressions/StringsExpression.php +++ b/src/flextype/core/Entries/Expressions/StringsExpression.php @@ -25,7 +25,7 @@ class StringsExpression implements ExpressionFunctionProviderInterface public function getFunctions() { return [ - new ExpressionFunction('strings', fn($str) => 'strings($str)', fn($arguments, $str) => strings($str)) + new ExpressionFunction('strings', fn($str) => '\Glowy\Strings\strings($str)', fn($arguments, $str) => strings($str)) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/UrlExpression.php b/src/flextype/core/Entries/Expressions/UrlExpression.php index 218a8e26..1578f40b 100644 --- a/src/flextype/core/Entries/Expressions/UrlExpression.php +++ b/src/flextype/core/Entries/Expressions/UrlExpression.php @@ -18,22 +18,32 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\urlFor; +use function Flextype\fullUrlFor; +use function Flextype\isCurrentUrl; +use function Flextype\getCurrentUrl; +use function Flextype\getBasePath; +use function Flextype\getBaseUrl; +use function Flextype\getAbsoluteUrl; +use function Flextype\getProjectUrl; +use function Flextype\getUriString; +use function Flextype\redirect; class UrlExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('urlFor', fn(string $routeName, array $data = [], array $queryParams = []) => 'urlFor($routeName, $data, $queryParams)', fn(string $routeName, array $data = [], array $queryParams = []) => urlFor($routeName, $data, $queryParams)), - new ExpressionFunction('fullUrlFor', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = [], array $queryParams = []) => 'fullUrlFor($request, $routeName, $data, $queryParams)', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = [], array $queryParams = []) => fullUrlFor($request, $routeName, $data = [], $queryParams = [])), - new ExpressionFunction('isCurrentUrl', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = []) => 'isCurrentUrl($request, $routeName, $data)', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = []) => isCurrentUrl($request, $routeName, $data = [])), - new ExpressionFunction('getCurrentUrl', fn(\Psr\Http\Message\ServerRequestInterface $request, bool $withQueryString = false) => 'getCurrentUrl($request, $withQueryString)', fn(\Psr\Http\Message\ServerRequestInterface $request, bool $withQueryString = false) => getCurrentUrl($request, $withQueryString)), - new ExpressionFunction('getBasePath', fn() => 'getBasePath()', fn() => getBasePath()), - new ExpressionFunction('getBaseUrl', fn() => 'getBaseUrl()', fn() => getBaseUrl()), - new ExpressionFunction('getAbsoluteUrl', fn() => 'getAbsoluteUrl()', fn() => getAbsoluteUrl()), - new ExpressionFunction('getProjectUrl', fn() => 'getProjectUrl()', fn() => getProjectUrl()), - new ExpressionFunction('getUriString', fn() => 'getUriString()', fn() => getUriString()), - new ExpressionFunction('redirect', fn(string $routeName, array $data = [], array $queryParams = [], int $status = 301) => 'redirect($routeName, $data, $queryParams, $status)', fn(string $routeName, array $data = [], array $queryParams = [], int $status = 301) => redirect($routeName, $data, $queryParams, $status)) + new ExpressionFunction('urlFor', fn(string $routeName, array $data = [], array $queryParams = []) => '\Flextype\urlFor($routeName, $data, $queryParams)', fn(string $routeName, array $data = [], array $queryParams = []) => urlFor($routeName, $data, $queryParams)), + new ExpressionFunction('fullUrlFor', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = [], array $queryParams = []) => '\Flextype\fullUrlFor($request, $routeName, $data, $queryParams)', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = [], array $queryParams = []) => fullUrlFor($request, $routeName, $data = [], $queryParams = [])), + new ExpressionFunction('isCurrentUrl', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = []) => '\Flextype\isCurrentUrl($request, $routeName, $data)', fn(\Psr\Http\Message\ServerRequestInterface $request, string $routeName, array $data = []) => isCurrentUrl($request, $routeName, $data = [])), + new ExpressionFunction('getCurrentUrl', fn(\Psr\Http\Message\ServerRequestInterface $request, bool $withQueryString = false) => '\Flextype\getCurrentUrl($request, $withQueryString)', fn(\Psr\Http\Message\ServerRequestInterface $request, bool $withQueryString = false) => getCurrentUrl($request, $withQueryString)), + new ExpressionFunction('getBasePath', fn() => '\Flextype\getBasePath()', fn() => getBasePath()), + new ExpressionFunction('getBaseUrl', fn() => '\Flextype\getBaseUrl()', fn() => getBaseUrl()), + new ExpressionFunction('getAbsoluteUrl', fn() => '\Flextype\getAbsoluteUrl()', fn() => getAbsoluteUrl()), + new ExpressionFunction('getProjectUrl', fn() => '\Flextype\getProjectUrl()', fn() => getProjectUrl()), + new ExpressionFunction('getUriString', fn() => '\Flextype\getUriString()', fn() => getUriString()), + new ExpressionFunction('redirect', fn(string $routeName, array $data = [], array $queryParams = [], int $status = 301) => '\Flextype\redirect($routeName, $data, $queryParams, $status)', fn(string $routeName, array $data = [], array $queryParams = [], int $status = 301) => redirect($routeName, $data, $queryParams, $status)) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Expressions/VarExpression.php b/src/flextype/core/Entries/Expressions/VarExpression.php index a211e1a8..9fba6945 100644 --- a/src/flextype/core/Entries/Expressions/VarExpression.php +++ b/src/flextype/core/Entries/Expressions/VarExpression.php @@ -18,13 +18,14 @@ namespace Flextype\Entries\Expressions; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; +use function Flextype\entries; class VarExpression implements ExpressionFunctionProviderInterface { public function getFunctions() { return [ - new ExpressionFunction('var', fn(string $var) => "entries()->registry()->get('methods.fetch.result.vars.' . $var . ')'", fn($arguments, string $var) => entries()->registry()->get('methods.fetch.result.vars.' . $var)) + new ExpressionFunction('var', fn(string $var) => "\Flextype\entries()->registry()->get('methods.fetch.result.vars.' . $var . ')'", fn($arguments, string $var) => entries()->registry()->get('methods.fetch.result.vars.' . $var)) ]; } } \ No newline at end of file diff --git a/src/flextype/core/Entries/Fields/Default/CreatedAtField.php b/src/flextype/core/Entries/Fields/Default/CreatedAtField.php index a675958d..3c387075 100644 --- a/src/flextype/core/Entries/Fields/Default/CreatedAtField.php +++ b/src/flextype/core/Entries/Fields/Default/CreatedAtField.php @@ -16,6 +16,9 @@ declare(strict_types=1); use function Glowy\Strings\strings; use function Glowy\Filesystem\filesystem; +use function Flextype\emitter; +use function Flextype\entries; +use function Flextype\registry; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/CreatedByField.php b/src/flextype/core/Entries/Fields/Default/CreatedByField.php index 03b9d0fe..e384c4f3 100644 --- a/src/flextype/core/Entries/Fields/Default/CreatedByField.php +++ b/src/flextype/core/Entries/Fields/Default/CreatedByField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesCreate', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/IdField.php b/src/flextype/core/Entries/Fields/Default/IdField.php index d416a942..864aa003 100644 --- a/src/flextype/core/Entries/Fields/Default/IdField.php +++ b/src/flextype/core/Entries/Fields/Default/IdField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php b/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php index b13a6f5d..fb113df3 100644 --- a/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php +++ b/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php @@ -16,6 +16,8 @@ declare(strict_types=1); use function Glowy\Strings\strings; use function Glowy\Filesystem\filesystem; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/PublishedAtField.php b/src/flextype/core/Entries/Fields/Default/PublishedAtField.php index ccf3a3d6..f4d77745 100644 --- a/src/flextype/core/Entries/Fields/Default/PublishedAtField.php +++ b/src/flextype/core/Entries/Fields/Default/PublishedAtField.php @@ -16,6 +16,9 @@ declare(strict_types=1); use function Glowy\Strings\strings; use function Glowy\Filesystem\filesystem; +use function Flextype\registry; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/PublishedByField.php b/src/flextype/core/Entries/Fields/Default/PublishedByField.php index 24617ac2..060b7908 100644 --- a/src/flextype/core/Entries/Fields/Default/PublishedByField.php +++ b/src/flextype/core/Entries/Fields/Default/PublishedByField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesCreate', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/RoutableField.php b/src/flextype/core/Entries/Fields/Default/RoutableField.php index 09ad5127..919c52a3 100644 --- a/src/flextype/core/Entries/Fields/Default/RoutableField.php +++ b/src/flextype/core/Entries/Fields/Default/RoutableField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/SlugField.php b/src/flextype/core/Entries/Fields/Default/SlugField.php index 39c90d74..74695c71 100644 --- a/src/flextype/core/Entries/Fields/Default/SlugField.php +++ b/src/flextype/core/Entries/Fields/Default/SlugField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/UuidField.php b/src/flextype/core/Entries/Fields/Default/UuidField.php index a8f54074..69a97d8c 100644 --- a/src/flextype/core/Entries/Fields/Default/UuidField.php +++ b/src/flextype/core/Entries/Fields/Default/UuidField.php @@ -16,6 +16,8 @@ declare(strict_types=1); use Ramsey\Uuid\Uuid; use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesCreate', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Default/VisibilityField.php b/src/flextype/core/Entries/Fields/Default/VisibilityField.php index a7231379..40cef772 100644 --- a/src/flextype/core/Entries/Fields/Default/VisibilityField.php +++ b/src/flextype/core/Entries/Fields/Default/VisibilityField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php b/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php index b7562a5b..f4c36fbe 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesCreate', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php b/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php index 2a61f8ef..db76070f 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php b/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php index 8eb63018..3401e97b 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesCreate', static function (): void { diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php b/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php index 796e7a55..f614c67f 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php @@ -15,6 +15,8 @@ declare(strict_types=1); */ use function Glowy\Strings\strings; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesCreate', static function (): void { diff --git a/src/flextype/core/Entries/Macros/EntriesMacros.php b/src/flextype/core/Entries/Macros/EntriesMacros.php index 2df66384..652ca9bb 100644 --- a/src/flextype/core/Entries/Macros/EntriesMacros.php +++ b/src/flextype/core/Entries/Macros/EntriesMacros.php @@ -16,7 +16,10 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\emitter; +use function Flextype\entries; +use function Flextype\collection; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Entries/Macros/PhpMacros.php b/src/flextype/core/Entries/Macros/PhpMacros.php index d147e119..0c3714db 100644 --- a/src/flextype/core/Entries/Macros/PhpMacros.php +++ b/src/flextype/core/Entries/Macros/PhpMacros.php @@ -14,7 +14,9 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\emitter; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { if (! registry()->get('flextype.settings.entries.macros.php.enabled')) { diff --git a/src/flextype/core/Entries/Macros/RegistryMacros.php b/src/flextype/core/Entries/Macros/RegistryMacros.php index 1673cee7..bde14c42 100644 --- a/src/flextype/core/Entries/Macros/RegistryMacros.php +++ b/src/flextype/core/Entries/Macros/RegistryMacros.php @@ -14,7 +14,10 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\emitter; +use function Flextype\collection; +use function Flextype\entries; emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { diff --git a/src/flextype/core/Middlewares/CsrfMiddleware.php b/src/flextype/core/Middlewares/CsrfMiddleware.php index b5705d34..aec4b744 100644 --- a/src/flextype/core/Middlewares/CsrfMiddleware.php +++ b/src/flextype/core/Middlewares/CsrfMiddleware.php @@ -19,6 +19,7 @@ namespace Flextype\Middlewares; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\RequestHandlerInterface as RequestHandler; use Slim\Psr7\Response; +use function Flextype\csrf; class CsrfMiddleware { diff --git a/src/flextype/core/Parsers/Markdown.php b/src/flextype/core/Parsers/Markdown.php index 1b3a65f0..f3d4a6af 100644 --- a/src/flextype/core/Parsers/Markdown.php +++ b/src/flextype/core/Parsers/Markdown.php @@ -23,8 +23,8 @@ use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use League\CommonMark\Extension\Table\TableExtension; use League\CommonMark\MarkdownConverter; -use function cache; -use function Glowy\Registry\registry; +use function Flextype\cache; +use function Flextype\registry; use function Glowy\Strings\strings; final class Markdown diff --git a/src/flextype/core/Parsers/Shortcodes.php b/src/flextype/core/Parsers/Shortcodes.php index 098ca82a..3d54fef7 100644 --- a/src/flextype/core/Parsers/Shortcodes.php +++ b/src/flextype/core/Parsers/Shortcodes.php @@ -22,11 +22,11 @@ use Thunder\Shortcode\ShortcodeFacade; use Thunder\Shortcode\Syntax\Syntax; use Thunder\Shortcode\Parser\RegularParser; -use function cache; +use function Flextype\cache; use function count; use function file_exists; use function is_array; -use function Glowy\Registry\registry; +use function Flextype\registry; use function Glowy\Strings\strings; final class Shortcodes diff --git a/src/flextype/core/Parsers/Shortcodes/CalcShortcode.php b/src/flextype/core/Parsers/Shortcodes/CalcShortcode.php index 773383da..35f25a2b 100644 --- a/src/flextype/core/Parsers/Shortcodes/CalcShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/CalcShortcode.php @@ -17,8 +17,9 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function Glowy\Registry\registry; -use function expression; +use function Flextype\registry; +use function Flextype\expression; +use function Flextype\parsers; // Shortcode: calc // Usage: (calc:2+2) diff --git a/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php b/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php index e805c7d7..410878fc 100644 --- a/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php @@ -17,7 +17,8 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\parsers; // Shortcode: const // Usage: (const:PROJECT_DIR) diff --git a/src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php b/src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php index 271f621b..af08fe1e 100644 --- a/src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php @@ -19,9 +19,11 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Flextype\Entries\Entries; -use function entries; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\entries; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\collection; +use function Flextype\collectionFromJson; use function Glowy\Strings\strings; // Shortcode: entries diff --git a/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php b/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php index 7e890e22..4651c868 100644 --- a/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php @@ -17,8 +17,9 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function Glowy\Registry\registry; -use function expression; +use function Flextype\registry; +use function Flextype\expression; +use function Flextype\parsers; // Shortcode: eval // Usage: (eval:2+2) diff --git a/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php b/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php index 5cfe30ec..a3370a97 100644 --- a/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php @@ -17,7 +17,9 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\parsers; +use function Flextype\entries; // Shortcode: field // Usage: (field:title) diff --git a/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php b/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php index e4ce0d71..1427b230 100644 --- a/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php @@ -18,6 +18,9 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use function Glowy\Filesystem\filesystem; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\collection; // Shortcode: filesystem // Usage: (filesystem get file:'1.txt) diff --git a/src/flextype/core/Parsers/Shortcodes/I18nShortcode.php b/src/flextype/core/Parsers/Shortcodes/I18nShortcode.php index 39ca2dce..9d82b25c 100644 --- a/src/flextype/core/Parsers/Shortcodes/I18nShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/I18nShortcode.php @@ -18,8 +18,10 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\collectionFromQueryString; +use function Flextype\__; // Shortcode: tr // Usage: (tr:foo values='foo=Foo' locale:'en_US') diff --git a/src/flextype/core/Parsers/Shortcodes/IfShortcode.php b/src/flextype/core/Parsers/Shortcodes/IfShortcode.php index 000e714b..e689acdd 100644 --- a/src/flextype/core/Parsers/Shortcodes/IfShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/IfShortcode.php @@ -19,8 +19,9 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\expression; // Shortcode: if // Usage: (if:'(var:score) < (var:level1)') Show something... (/if) diff --git a/src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php b/src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php index 83267429..81df42bd 100644 --- a/src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/MarkdownShortcode.php @@ -17,7 +17,8 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function parsers; +use function Flextype\parsers; +use function Flextype\registry; // Shortcode: markdown // Usage: (markdown) markdown text here (/markdown) diff --git a/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php b/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php index ed4c48a6..c876d48a 100644 --- a/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/PhpShortcode.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; +use function Flextype\registry; +use function Flextype\parsers; // Shortcode: php // Usage: (php) php code here (/php) diff --git a/src/flextype/core/Parsers/Shortcodes/RawShortcode.php b/src/flextype/core/Parsers/Shortcodes/RawShortcode.php index 1f284c22..480cd9b6 100644 --- a/src/flextype/core/Parsers/Shortcodes/RawShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/RawShortcode.php @@ -20,7 +20,8 @@ use Thunder\Shortcode\EventHandler\FilterRawEventHandler; use Thunder\Shortcode\Events; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function parsers; +use function Flextype\parsers; +use function Flextype\registry; // Shortcode: raw // Usage: (raw) shortcodes to escape (/raw) diff --git a/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php b/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php index ccfc0146..25241170 100644 --- a/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php @@ -18,8 +18,10 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\serializers; +use function Flextype\collection; // Shortcode: registry // Usage: (registry get id:'flextype.manifest.version') diff --git a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php index 28e9305b..d2f72984 100644 --- a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php @@ -17,8 +17,9 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\serializers; +use function Flextype\registry; use function Glowy\Strings\strings; // Shortcode: strings diff --git a/src/flextype/core/Parsers/Shortcodes/TextileShortcode.php b/src/flextype/core/Parsers/Shortcodes/TextileShortcode.php index 22b5b720..6feb7a95 100644 --- a/src/flextype/core/Parsers/Shortcodes/TextileShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/TextileShortcode.php @@ -17,7 +17,8 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function parsers; +use function Flextype\parsers; +use function Flextype\registry; // Shortcode: textile // Usage: (textile) markdown text here (/textile) diff --git a/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php b/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php index 95d5b21e..70922418 100644 --- a/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php @@ -17,7 +17,8 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\parsers; // Shortcode: type // Usage: (type:string) diff --git a/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php b/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php index e8d83428..be2b2809 100644 --- a/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php @@ -19,8 +19,9 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\expression; // Shortcode: unless // Usage: (unless:'(var:score) < (var:level1)') Show something... (/when) diff --git a/src/flextype/core/Parsers/Shortcodes/UrlShortcode.php b/src/flextype/core/Parsers/Shortcodes/UrlShortcode.php index 8fc105cc..aec61b57 100644 --- a/src/flextype/core/Parsers/Shortcodes/UrlShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/UrlShortcode.php @@ -17,9 +17,17 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function app; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\app; +use function Flextype\parsers; +use function Flextype\serializers; +use function Flextype\registry; +use function Flextype\getBaseUrl; +use function Flextype\getBasePath; +use function Flextype\getAbsoluteUrl; +use function Flextype\getProjectUrl; +use function Flextype\getUriString; +use function Flextype\urlFor; + // Shortcode: getBaseUrl // Usage: (getBaseUrl) diff --git a/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php b/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php index 44682538..142b804d 100644 --- a/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php @@ -18,8 +18,8 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Ramsey\Uuid\Uuid; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\registry; use function Glowy\Strings\strings; // Shortcode: uuid diff --git a/src/flextype/core/Parsers/Shortcodes/VarShortcode.php b/src/flextype/core/Parsers/Shortcodes/VarShortcode.php index a8caa9df..90edb5a3 100644 --- a/src/flextype/core/Parsers/Shortcodes/VarShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/VarShortcode.php @@ -17,7 +17,9 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function Glowy\Registry\registry; +use function Flextype\registry; +use function Flextype\parsers; +use function Flextype\entries; // Shortcode: var // Usage: (var:foo) diff --git a/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php b/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php index 3d603272..5267674f 100644 --- a/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php @@ -19,8 +19,9 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; -use function parsers; -use function Glowy\Registry\registry; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\expression; // Shortcode: when // Usage: (when:'(var:score) < (var:level1)') Show something... (/when) diff --git a/src/flextype/core/Parsers/Textile.php b/src/flextype/core/Parsers/Textile.php index 72e5c68c..0fd8312f 100644 --- a/src/flextype/core/Parsers/Textile.php +++ b/src/flextype/core/Parsers/Textile.php @@ -19,8 +19,8 @@ namespace Flextype\Parsers; use Exception; use Netcarver\Textile\Parser; -use function cache; -use function Glowy\Registry\registry; +use function Flextype\cache; +use function Flextype\registry; use function Glowy\Strings\strings; final class Textile diff --git a/src/flextype/core/Plugins.php b/src/flextype/core/Plugins.php index 198f2b6e..c53e3f2f 100755 --- a/src/flextype/core/Plugins.php +++ b/src/flextype/core/Plugins.php @@ -27,7 +27,6 @@ use function Glowy\Arrays\arrays; use function count; use function filemtime; use function Glowy\Filesystem\filesystem; -use function flextype; use function is_array; use function md5; use function trim; diff --git a/src/flextype/core/Serializers/Frontmatter.php b/src/flextype/core/Serializers/Frontmatter.php index 6e7b72e5..2e8eebc7 100644 --- a/src/flextype/core/Serializers/Frontmatter.php +++ b/src/flextype/core/Serializers/Frontmatter.php @@ -18,15 +18,16 @@ namespace Flextype\Serializers; use function array_slice; use function Glowy\Arrays\arrays; -use function cache; +use function Flextype\cache; use function count; use function implode; use function in_array; use function ltrim; use function preg_replace; use function preg_split; -use function registry; -use function serializers; +use function Flextype\registry; +use function Flextype\serializers; +use function Flextype\collection; use function Glowy\Strings\strings; use const PHP_EOL; diff --git a/src/flextype/core/Serializers/Json.php b/src/flextype/core/Serializers/Json.php index 64b45896..d42d0b4c 100644 --- a/src/flextype/core/Serializers/Json.php +++ b/src/flextype/core/Serializers/Json.php @@ -18,13 +18,13 @@ namespace Flextype\Serializers; use RuntimeException; -use function cache; +use function Flextype\cache; use function defined; use function json_decode; use function json_encode; use function json_last_error; use function json_last_error_msg; -use function registry; +use function Flextype\registry; use function Glowy\Strings\strings; use const JSON_PRESERVE_ZERO_FRACTION; diff --git a/src/flextype/core/Serializers/Json5.php b/src/flextype/core/Serializers/Json5.php index 70607951..2ecb72cb 100644 --- a/src/flextype/core/Serializers/Json5.php +++ b/src/flextype/core/Serializers/Json5.php @@ -18,13 +18,13 @@ namespace Flextype\Serializers; use RuntimeException; -use function cache; +use function Flextype\cache; use function defined; use function json_decode; use function json_encode; use function json_last_error; use function json_last_error_msg; -use function registry; +use function Flextype\registry; use function Glowy\Strings\strings; use const JSON_PRESERVE_ZERO_FRACTION; diff --git a/src/flextype/core/Serializers/Neon.php b/src/flextype/core/Serializers/Neon.php index e04d7cc7..31508e73 100644 --- a/src/flextype/core/Serializers/Neon.php +++ b/src/flextype/core/Serializers/Neon.php @@ -20,8 +20,8 @@ use Nette\Neon\Exception; use Nette\Neon\Neon as NeonSerializer; use RuntimeException; -use function cache; -use function registry; +use function Flextype\cache; +use function Flextype\registry; use function Glowy\Strings\strings; class Neon diff --git a/src/flextype/core/Serializers/PhpArray.php b/src/flextype/core/Serializers/PhpArray.php index aa29fbc8..7cab1e20 100644 --- a/src/flextype/core/Serializers/PhpArray.php +++ b/src/flextype/core/Serializers/PhpArray.php @@ -21,8 +21,8 @@ use Symfony\Component\VarExporter\VarExporter; use RuntimeException; use Exception; -use function cache; -use function registry; +use function Flextype\cache; +use function Flextype\registry; use function Glowy\Strings\strings; use function var_export; diff --git a/src/flextype/core/Serializers/Yaml.php b/src/flextype/core/Serializers/Yaml.php index 17fe1c66..08442d66 100644 --- a/src/flextype/core/Serializers/Yaml.php +++ b/src/flextype/core/Serializers/Yaml.php @@ -21,12 +21,12 @@ use Symfony\Component\Yaml\Exception\DumpException as SymfonyYamlDumpException; use Symfony\Component\Yaml\Exception\ParseException as SymfonyYamlParseException; use Symfony\Component\Yaml\Yaml as SymfonyYaml; -use function cache; +use function Flextype\cache; use function error_reporting; use function function_exists; use function ini_get; use function ini_set; -use function registry; +use function Flextype\registry; use function Glowy\Strings\strings; class Yaml diff --git a/src/flextype/flextype.php b/src/flextype/flextype.php index e8b4473f..4e44559b 100644 --- a/src/flextype/flextype.php +++ b/src/flextype/flextype.php @@ -51,19 +51,19 @@ use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use Flextype\Middlewares\WhoopsMiddleware; use Flextype\Console\FlextypeConsole; -use function app; +use function Flextype\app; use function array_replace_recursive; -use function container; +use function Flextype\container; use function count; use function date; use function date_default_timezone_set; use function define; -use function emitter; +use function Flextype\emitter; use function extension_loaded; use function file_exists; use function filemtime; use function Glowy\Filesystem\filesystem; -use function flextype; +use function Flextype\flextype; use function function_exists; use function implode; use function in_array; @@ -71,11 +71,11 @@ use function mb_internal_encoding; use function mb_language; use function mb_regex_encoding; use function md5; -use function parsers; -use function plugins; +use function Flextype\parsers; +use function Flextype\plugins; use function register_shutdown_function; use function Glowy\Registry\registry; -use function session; +use function Flextype\session; use function Glowy\Strings\strings; use function sys_get_temp_dir; use function trim; diff --git a/src/flextype/helpers/collection.php b/src/flextype/helpers/collection.php index ed20a886..8824e017 100644 --- a/src/flextype/helpers/collection.php +++ b/src/flextype/helpers/collection.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + use Glowy\Arrays\Arrays as Collection; if (! function_exists('collection')) { diff --git a/src/flextype/helpers/finder.php b/src/flextype/helpers/finder.php index 8c107fac..fe0bdfb3 100644 --- a/src/flextype/helpers/finder.php +++ b/src/flextype/helpers/finder.php @@ -2,8 +2,9 @@ declare(strict_types=1); -use Symfony\Component\Finder\Finder; +namespace Flextype; +use Symfony\Component\Finder\Finder; use function Glowy\Filesystem\filesystem; if (! function_exists('find')) { diff --git a/src/flextype/helpers/helpers.php b/src/flextype/helpers/helpers.php index dca3c675..efbd3991 100644 --- a/src/flextype/helpers/helpers.php +++ b/src/flextype/helpers/helpers.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + require_once __DIR__ . '/i18n.php'; require_once __DIR__ . '/services.php'; require_once __DIR__ . '/collection.php'; diff --git a/src/flextype/helpers/i18n.php b/src/flextype/helpers/i18n.php index 51e8090e..cfe06077 100644 --- a/src/flextype/helpers/i18n.php +++ b/src/flextype/helpers/i18n.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + use Flextype\I18n; if ( ! function_exists('__')) { diff --git a/src/flextype/helpers/image.php b/src/flextype/helpers/image.php index 65369dea..8c7932ba 100644 --- a/src/flextype/helpers/image.php +++ b/src/flextype/helpers/image.php @@ -2,6 +2,9 @@ declare(strict_types=1); +namespace Flextype; + +use Closure; use Intervention\Image\ImageManagerStatic as Image; if (! function_exists('imageFile')) { diff --git a/src/flextype/helpers/services.php b/src/flextype/helpers/services.php index f23a50be..f793fb2b 100644 --- a/src/flextype/helpers/services.php +++ b/src/flextype/helpers/services.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + use Flextype\Flextype; if (! function_exists('flextype')) { diff --git a/src/flextype/helpers/tokens.php b/src/flextype/helpers/tokens.php index b53cf538..2fe160e6 100644 --- a/src/flextype/helpers/tokens.php +++ b/src/flextype/helpers/tokens.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + if (! function_exists('generateToken')) { /** * Generate token. diff --git a/src/flextype/helpers/upload.php b/src/flextype/helpers/upload.php index 20d9d313..0210845d 100644 --- a/src/flextype/helpers/upload.php +++ b/src/flextype/helpers/upload.php @@ -2,6 +2,9 @@ declare(strict_types=1); +namespace Flextype; + +use Throwable; use Sirius\Upload\Handler as UploadHandler; use Sirius\Upload\Result\File as UploadResultFile; use function Glowy\Strings\strings; diff --git a/src/flextype/helpers/url.php b/src/flextype/helpers/url.php index c6449795..bafb617c 100644 --- a/src/flextype/helpers/url.php +++ b/src/flextype/helpers/url.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + use Slim\Interfaces\RouteParserInterface; use Psr\Http\Message\UriInterface; use Psr\Http\Message\ServerRequestInterface; diff --git a/src/flextype/macros/collection.php b/src/flextype/macros/collection.php index d2871f71..a9887dc1 100644 --- a/src/flextype/macros/collection.php +++ b/src/flextype/macros/collection.php @@ -2,7 +2,10 @@ declare(strict_types=1); +namespace Flextype; + use Glowy\Arrays\Arrays as Collection; +use function Glowy\Arrays\arrays as collection; if (! Collection::hasMacro('onlyFromCollection')) { /** diff --git a/src/flextype/macros/macros.php b/src/flextype/macros/macros.php index 8c030254..22cb312a 100644 --- a/src/flextype/macros/macros.php +++ b/src/flextype/macros/macros.php @@ -2,4 +2,6 @@ declare(strict_types=1); +namespace Flextype; + require_once __DIR__ . '/collection.php'; \ No newline at end of file diff --git a/src/flextype/routes/endpoints/cache.php b/src/flextype/routes/endpoints/cache.php index 0b66b698..d940e482 100644 --- a/src/flextype/routes/endpoints/cache.php +++ b/src/flextype/routes/endpoints/cache.php @@ -18,7 +18,7 @@ namespace Flextype; use Flextype\Endpoints\Cache; -use function app; +use function Flextype\app; /** * Clear cache. diff --git a/src/flextype/routes/endpoints/entries.php b/src/flextype/routes/endpoints/entries.php index 198484b2..f1c9a069 100644 --- a/src/flextype/routes/endpoints/entries.php +++ b/src/flextype/routes/endpoints/entries.php @@ -18,7 +18,7 @@ namespace Flextype; use Flextype\Endpoints\Entries; -use function app; +use function Flextype\app; /** * Fetch entry diff --git a/src/flextype/routes/endpoints/registry.php b/src/flextype/routes/endpoints/registry.php index 790e6c61..dc37d193 100644 --- a/src/flextype/routes/endpoints/registry.php +++ b/src/flextype/routes/endpoints/registry.php @@ -18,7 +18,7 @@ namespace Flextype; use Flextype\Endpoints\Registry; -use function app; +use function Flextype\app; /** * Get registry item diff --git a/src/flextype/routes/endpoints/tokens.php b/src/flextype/routes/endpoints/tokens.php index b7c773e8..960f0fac 100644 --- a/src/flextype/routes/endpoints/tokens.php +++ b/src/flextype/routes/endpoints/tokens.php @@ -18,7 +18,7 @@ namespace Flextype; use Flextype\Endpoints\Tokens; -use function app; +use function Flextype\app; /** * Generate token diff --git a/src/flextype/routes/routes.php b/src/flextype/routes/routes.php index 01821bc0..16840c01 100644 --- a/src/flextype/routes/routes.php +++ b/src/flextype/routes/routes.php @@ -2,6 +2,8 @@ declare(strict_types=1); +namespace Flextype; + use function Glowy\Filesystem\filesystem; // Add endpoints routes diff --git a/tests/fixtures/entries/blog-php-macros/entry.yaml b/tests/fixtures/entries/blog-php-macros/entry.yaml index 637486fe..3fcbffc1 100644 --- a/tests/fixtures/entries/blog-php-macros/entry.yaml +++ b/tests/fixtures/entries/blog-php-macros/entry.yaml @@ -1,6 +1,6 @@ title: Blog macros: php: | - $entry = entries()->registry()->get('methods.fetch'); - $entry['result']['posts'] = entries()->fetch('blog', ['collection' => true, 'filter' => ['sort_by' => ['key' => 'date', 'direction' => 'ASC']]])->toArray(); - entries()->registry()->set('methods.fetch', $entry); \ No newline at end of file + $entry = \Flextype\entries()->registry()->get('methods.fetch'); + $entry['result']['posts'] = \Flextype\entries()->fetch('blog', ['collection' => true, 'filter' => ['sort_by' => ['key' => 'date', 'direction' => 'ASC']]])->toArray(); + \Flextype\entries()->registry()->set('methods.fetch', $entry); \ No newline at end of file diff --git a/tests/src/flextype/HelpersTest.php b/tests/src/flextype/HelpersTest.php index bdf4c0c4..45758ba7 100644 --- a/tests/src/flextype/HelpersTest.php +++ b/tests/src/flextype/HelpersTest.php @@ -20,6 +20,24 @@ use Cocur\Slugify\Slugify; use Glowy\Arrays\Arrays; use function Glowy\Filesystem\filesystem; use function Glowy\Strings\strings; +use function Flextype\flextype; +use function Flextype\parsers; +use function Flextype\serializers; +use function Flextype\generateTokenHash; +use function Flextype\logger; +use function Flextype\app; +use function Flextype\container; +use function Flextype\emitter; +use function Flextype\registry; +use function Flextype\session; +use function Flextype\console; +use function Flextype\cache; +use function Flextype\entries; +use function Flextype\generateToken; +use function Flextype\find; +use function Flextype\slugify; +use function Flextype\csrf; +use function Flextype\verifyTokenHash; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/ActionsTest.php b/tests/src/flextype/core/ActionsTest.php index 7b8fba3f..2cddb4c3 100644 --- a/tests/src/flextype/core/ActionsTest.php +++ b/tests/src/flextype/core/ActionsTest.php @@ -3,6 +3,7 @@ declare(strict_types = 1); use Flextype\Actions; +use function Flextype\actions; test('test getInstance() method', function() { $this->assertInstanceOf(Actions::class, Actions::getInstance()); diff --git a/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php index 1f89e8c6..b0026c7a 100644 --- a/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php index 04720ae7..2f315f1b 100644 --- a/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php index cc8640ac..95898e3a 100644 --- a/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php index 38e914ac..109ecc7f 100644 --- a/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php index 767bb4a9..ca36a4eb 100644 --- a/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php index 09f25749..8212efce 100644 --- a/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/EntriesTest.php b/tests/src/flextype/core/Entries/EntriesTest.php index a525b4b7..c75474b7 100644 --- a/tests/src/flextype/core/Entries/EntriesTest.php +++ b/tests/src/flextype/core/Entries/EntriesTest.php @@ -4,6 +4,8 @@ use Glowy\Arrays\Arrays; use Flextype\Entries\Entries; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Entries/Expressions/ActionsExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/ActionsExpressionTest.php index 01f21be8..c9fd321e 100644 --- a/tests/src/flextype/core/Entries/Expressions/ActionsExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/ActionsExpressionTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\actions; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/CollectionExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/CollectionExpressionTest.php index 5ad46d62..8b5c92a8 100644 --- a/tests/src/flextype/core/Entries/Expressions/CollectionExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/CollectionExpressionTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/ConstExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/ConstExpressionTest.php index 3ab0e98a..76737689 100644 --- a/tests/src/flextype/core/Entries/Expressions/ConstExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/ConstExpressionTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/CsrfExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/CsrfExpressionTest.php index bae56d5b..4ddd2236 100644 --- a/tests/src/flextype/core/Entries/Expressions/CsrfExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/CsrfExpressionTest.php @@ -4,6 +4,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; use function Glowy\Strings\strings; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/EntriesExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/EntriesExpressionTest.php index 875e6744..0164f298 100644 --- a/tests/src/flextype/core/Entries/Expressions/EntriesExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/EntriesExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/FieldExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/FieldExpressionTest.php index fa6b1d7d..cafef279 100644 --- a/tests/src/flextype/core/Entries/Expressions/FieldExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/FieldExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/FilesystemExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/FilesystemExpressionTest.php index 6da1a7b4..bca23724 100644 --- a/tests/src/flextype/core/Entries/Expressions/FilesystemExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/FilesystemExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/I18nExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/I18nExpressionTest.php index 2bca9314..48dfc92c 100644 --- a/tests/src/flextype/core/Entries/Expressions/I18nExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/I18nExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/ParsersExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/ParsersExpressionTest.php index 22688346..79340543 100644 --- a/tests/src/flextype/core/Entries/Expressions/ParsersExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/ParsersExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/RegistryExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/RegistryExpressionTest.php index 9a6b8588..91aa245e 100644 --- a/tests/src/flextype/core/Entries/Expressions/RegistryExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/RegistryExpressionTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/SerializersExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/SerializersExpressionTest.php index 198bf3c6..a150dcc7 100644 --- a/tests/src/flextype/core/Entries/Expressions/SerializersExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/SerializersExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/SlugifyExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/SlugifyExpressionTest.php index 8d3b8cb3..6c6b7456 100644 --- a/tests/src/flextype/core/Entries/Expressions/SlugifyExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/SlugifyExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/StringsExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/StringsExpressionTest.php index 53b242b1..2a64fb71 100644 --- a/tests/src/flextype/core/Entries/Expressions/StringsExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/StringsExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Expressions/VarExpressionTest.php b/tests/src/flextype/core/Entries/Expressions/VarExpressionTest.php index 50844b50..9d0d834f 100644 --- a/tests/src/flextype/core/Entries/Expressions/VarExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/VarExpressionTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/CreatedAtFieldTest.php b/tests/src/flextype/core/Entries/Fields/CreatedAtFieldTest.php index 32561755..5cd5d442 100644 --- a/tests/src/flextype/core/Entries/Fields/CreatedAtFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/CreatedAtFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/CreatedByFieldTest.php b/tests/src/flextype/core/Entries/Fields/CreatedByFieldTest.php index 0be171b6..6148070c 100644 --- a/tests/src/flextype/core/Entries/Fields/CreatedByFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/CreatedByFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/IdFieldTest.php b/tests/src/flextype/core/Entries/Fields/IdFieldTest.php index 217f23c5..bab6edce 100644 --- a/tests/src/flextype/core/Entries/Fields/IdFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/IdFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/ModifiedAtFieldTest.php b/tests/src/flextype/core/Entries/Fields/ModifiedAtFieldTest.php index 18a2277d..a85aff5b 100644 --- a/tests/src/flextype/core/Entries/Fields/ModifiedAtFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/ModifiedAtFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/PublishedAtFieldTest.php b/tests/src/flextype/core/Entries/Fields/PublishedAtFieldTest.php index bb26479c..32afa591 100644 --- a/tests/src/flextype/core/Entries/Fields/PublishedAtFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/PublishedAtFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/PublishedByFieldTest.php b/tests/src/flextype/core/Entries/Fields/PublishedByFieldTest.php index c00c41b5..2627bacf 100644 --- a/tests/src/flextype/core/Entries/Fields/PublishedByFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/PublishedByFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/RoutableFieldTest.php b/tests/src/flextype/core/Entries/Fields/RoutableFieldTest.php index eb3ca628..0f445353 100644 --- a/tests/src/flextype/core/Entries/Fields/RoutableFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/RoutableFieldTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/SlugFieldTest.php b/tests/src/flextype/core/Entries/Fields/SlugFieldTest.php index 9e1a9ab3..39bb5b00 100644 --- a/tests/src/flextype/core/Entries/Fields/SlugFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/SlugFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/UuidFieldTest.php b/tests/src/flextype/core/Entries/Fields/UuidFieldTest.php index 262ae26c..bdf91019 100644 --- a/tests/src/flextype/core/Entries/Fields/UuidFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/UuidFieldTest.php @@ -4,6 +4,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; use Respect\Validation\Validator as v; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php b/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php index 4695b624..01d702fb 100644 --- a/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php @@ -3,6 +3,7 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Macros/EntriesMacrosTest.php b/tests/src/flextype/core/Entries/Macros/EntriesMacrosTest.php index 1a63ed52..b3ae62ff 100644 --- a/tests/src/flextype/core/Entries/Macros/EntriesMacrosTest.php +++ b/tests/src/flextype/core/Entries/Macros/EntriesMacrosTest.php @@ -3,6 +3,9 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\serializers; +use function Flextype\collection; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Macros/PhpMacrosTest.php b/tests/src/flextype/core/Entries/Macros/PhpMacrosTest.php index edbad69d..a394480c 100644 --- a/tests/src/flextype/core/Entries/Macros/PhpMacrosTest.php +++ b/tests/src/flextype/core/Entries/Macros/PhpMacrosTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\serializers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Entries/Macros/RegistryMacrosTest.php b/tests/src/flextype/core/Entries/Macros/RegistryMacrosTest.php index cbd96791..246f4535 100644 --- a/tests/src/flextype/core/Entries/Macros/RegistryMacrosTest.php +++ b/tests/src/flextype/core/Entries/Macros/RegistryMacrosTest.php @@ -3,6 +3,8 @@ use Flextype\Component\Filesystem\Filesystem; use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\serializers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); diff --git a/tests/src/flextype/core/Parsers/MarkdownTest.php b/tests/src/flextype/core/Parsers/MarkdownTest.php index d6c987a2..d9a80000 100644 --- a/tests/src/flextype/core/Parsers/MarkdownTest.php +++ b/tests/src/flextype/core/Parsers/MarkdownTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Flextype\parsers; + test('get markdown instance', function () { $this->assertInstanceOf(Flextype\Parsers\Markdown::class, parsers()->markdown()->getInstance()); }); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php index c0d32f81..95476f2a 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/ConstShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/ConstShortcodeTest.php index 4d5c2181..a05d9831 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/ConstShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/ConstShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/EntriesShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/EntriesShortcodeTest.php index d459ae2b..555e6698 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/EntriesShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/EntriesShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/EvalShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/EvalShortcodeTest.php index cf32cee6..c6fbf0cc 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/EvalShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/EvalShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/FieldShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/FieldShortcodeTest.php index 89d99760..ec284c19 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/FieldShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/FieldShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/FilesystemShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/FilesystemShortcodeTest.php index d501d678..b0d21863 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/FilesystemShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/FilesystemShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\parsers; beforeEach(function (): void { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/I18nShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/I18nShortcodeTest.php index 92bef23b..1c64baec 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/I18nShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/I18nShortcodeTest.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use function Flextype\parsers; +use function Flextype\registry; + test('tr shortcode', function () { expect(parsers()->shortcodes()->parse('(tr:foo)'))->toBe('foo'); }); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/IfShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/IfShortcodeTest.php index 10937463..3ababe95 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/IfShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/IfShortcodeTest.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use function Flextype\registry; +use function Flextype\parsers; + test('if shortcode', function () { expect(parsers()->shortcodes()->parse("(if:'2 > 1')yes(/if)"))->toBe("yes"); expect(parsers()->shortcodes()->parse("(if:'2>1')yes(/if)"))->toBe("yes"); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php index 22291530..5b5bac0d 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\parsers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/PhpShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/PhpShortcodeTest.php index d2f8114a..94143c7a 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/PhpShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/PhpShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\parsers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/RawShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/RawShortcodeTest.php index d47b5efe..8dde843f 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/RawShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/RawShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\entries; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/RegistryShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/RegistryShortcodeTest.php index 8e669a7b..256c2732 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/RegistryShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/RegistryShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Strings\strings; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\parsers; test('registry shortcode', function () { expect(strings(parsers()->shortcodes()->parse("(registry get id:'flextype.manifest')"))->isJson())->toBeTrue(); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php index b1b48294..e6f9ca5e 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Strings\strings; +use function Flextype\parsers; +use function Flextype\registry; test('strings shortcode', function () { diff --git a/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php index a013604b..de98e4e2 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\parsers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/TypeShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/TypeShortcodeTest.php index 64840a76..6ca501f2 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/TypeShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/TypeShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\registry; +use function Flextype\entries; +use function Flextype\parsers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/UnlessShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/UnlessShortcodeTest.php index f7c3e677..86fdfb14 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/UnlessShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/UnlessShortcodeTest.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use function Flextype\parsers; +use function Flextype\registry; + test('unless shortcode', function () { expect(parsers()->shortcodes()->parse("(unless:'2 > 1')yes(/unless)"))->toBe(""); expect(parsers()->shortcodes()->parse("(unless:'2>1')yes(/unless)"))->toBe(""); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/UrlShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/UrlShortcodeTest.php index dcbccffe..10c07a50 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/UrlShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/UrlShortcodeTest.php @@ -2,6 +2,10 @@ declare(strict_types=1); +use function Flextype\parsers; +use function Flextype\registry; +use function Flextype\app; + test('getBaseUrl shortcode', function () { registry()->set('flextype.settings.base_url', 'https://awilum.github.io/flextype'); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php index db4337b7..bbb8c7a6 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Strings\strings; +use function Flextype\registry; +use function Flextype\parsers; test('uuid shortcode', function () { expect(strings(parsers()->shortcodes()->parse('(uuid)'))->length() > 0)->toBeTrue(); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php index 4ad29d4c..cdf0c4ed 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php @@ -3,6 +3,9 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\entries; +use function Flextype\registry; +use function Flextype\parsers; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/WhenShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/WhenShortcodeTest.php index 87739be8..b9efb545 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/WhenShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/WhenShortcodeTest.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use function Flextype\registry; +use function Flextype\parsers; + test('when shortcode', function () { expect(parsers()->shortcodes()->parse("(when:'2 > 1')yes(/when)"))->toBe("yes"); expect(parsers()->shortcodes()->parse("(when:'2>1')yes(/when)"))->toBe("yes"); diff --git a/tests/src/flextype/core/Parsers/ShortcodesTest.php b/tests/src/flextype/core/Parsers/ShortcodesTest.php index 8cc366e3..1b0ddd95 100644 --- a/tests/src/flextype/core/Parsers/ShortcodesTest.php +++ b/tests/src/flextype/core/Parsers/ShortcodesTest.php @@ -7,6 +7,8 @@ use Thunder\Shortcode\EventHandler\FilterRawEventHandler; use Thunder\Shortcode\Events; use Thunder\Shortcode\Shortcode\ShortcodeInterface; +use function Flextype\parsers; + test('get shortcodes instance', function () { $this->assertInstanceOf(Flextype\Parsers\Shortcodes::class, parsers()->shortcodes()->getInstance()); }); diff --git a/tests/src/flextype/core/Parsers/TextileTest.php b/tests/src/flextype/core/Parsers/TextileTest.php index 589e438b..67694198 100644 --- a/tests/src/flextype/core/Parsers/TextileTest.php +++ b/tests/src/flextype/core/Parsers/TextileTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Flextype\parsers; + test('get textile instance', function () { $this->assertInstanceOf(Flextype\Parsers\Textile::class, parsers()->textile()->getInstance()); }); diff --git a/tests/src/flextype/core/PluginsTest.php b/tests/src/flextype/core/PluginsTest.php index d4593570..73b2482a 100644 --- a/tests/src/flextype/core/PluginsTest.php +++ b/tests/src/flextype/core/PluginsTest.php @@ -5,6 +5,8 @@ declare(strict_types=1); use Flextype\Flextype; use Glowy\Strings\Strings; use function Glowy\Filesystem\filesystem; +use function Flextype\parsers; +use function Flextype\plugins; beforeEach(function() { // Create sandbox plugin diff --git a/tests/src/flextype/core/Serializers/FrontmatterTest.php b/tests/src/flextype/core/Serializers/FrontmatterTest.php index 6278bb66..02471c0e 100644 --- a/tests/src/flextype/core/Serializers/FrontmatterTest.php +++ b/tests/src/flextype/core/Serializers/FrontmatterTest.php @@ -3,6 +3,7 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\serializers; test('encode', function () { $string = filesystem()->file(FLEXTYPE_ROOT_DIR . '/tests/fixtures/serializers/frontmatter.md')->get(); diff --git a/tests/src/flextype/core/Serializers/Json5Test.php b/tests/src/flextype/core/Serializers/Json5Test.php index 82e3791a..c6ff0a7d 100644 --- a/tests/src/flextype/core/Serializers/Json5Test.php +++ b/tests/src/flextype/core/Serializers/Json5Test.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Flextype\serializers; + test('encode', function () { $this->assertEquals('{"title":"Foo","content":"Bar"}', serializers()->json5() diff --git a/tests/src/flextype/core/Serializers/JsonTest.php b/tests/src/flextype/core/Serializers/JsonTest.php index 097a758e..7b3951a3 100644 --- a/tests/src/flextype/core/Serializers/JsonTest.php +++ b/tests/src/flextype/core/Serializers/JsonTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Flextype\serializers; + test('encode', function () { $this->assertEquals('{"title":"Foo","content":"Bar"}', serializers()->json() diff --git a/tests/src/flextype/core/Serializers/NeonTest.php b/tests/src/flextype/core/Serializers/NeonTest.php index b0eab2b1..19a28e21 100644 --- a/tests/src/flextype/core/Serializers/NeonTest.php +++ b/tests/src/flextype/core/Serializers/NeonTest.php @@ -4,6 +4,8 @@ declare(strict_types=1); use function Glowy\Filesystem\filesystem; +use function Flextype\serializers; + test('encode', function () { $string = filesystem()->file(FLEXTYPE_ROOT_DIR . '/tests/fixtures/serializers/neon.neon')->get(); $this->assertEquals(trim("{" . $string . "}"), diff --git a/tests/src/flextype/core/Serializers/PhpArrayTest.php b/tests/src/flextype/core/Serializers/PhpArrayTest.php index 57058fe4..a05b8c50 100644 --- a/tests/src/flextype/core/Serializers/PhpArrayTest.php +++ b/tests/src/flextype/core/Serializers/PhpArrayTest.php @@ -3,6 +3,8 @@ declare(strict_types=1); use function Glowy\Strings\strings; +use function Flextype\serializers; +use function Flextype\registry; test('encode', function () { $this->assertEquals(65, strings(serializers()->phparray()->encode(['title' => 'Foo', 'content' => 'Bar']))->length()); diff --git a/tests/src/flextype/core/Serializers/YamlTest.php b/tests/src/flextype/core/Serializers/YamlTest.php index ed049441..40094377 100644 --- a/tests/src/flextype/core/Serializers/YamlTest.php +++ b/tests/src/flextype/core/Serializers/YamlTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Flextype\serializers; + test('encode', function () { $this->assertEquals("title: Foo\ncontent: Bar\n", serializers()->yaml() diff --git a/tests/src/flextype/helpers/CollectionTest.php b/tests/src/flextype/helpers/CollectionTest.php index 9e9b45d0..8ca911e6 100644 --- a/tests/src/flextype/helpers/CollectionTest.php +++ b/tests/src/flextype/helpers/CollectionTest.php @@ -2,6 +2,11 @@ declare(strict_types=1); +use function Flextype\collection; +use function Flextype\collectionFromJson; +use function Flextype\collectionFromString; +use function Flextype\collectionWithRange; +use function Flextype\filterCollection; test('collection helper', function () { $this->assertEquals([], collection([])->toArray()); diff --git a/tests/src/flextype/macros/CollectionTest.php b/tests/src/flextype/macros/CollectionTest.php index dc17758f..ff5c837d 100644 --- a/tests/src/flextype/macros/CollectionTest.php +++ b/tests/src/flextype/macros/CollectionTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Flextype\collection; + test('onlyFromCollection macros', function () { expect(collection(['blog' => ['post-1' => 'Post 1', 'post-2' => 'Post 2']])->onlyFromCollection(['post-2'])->toArray())->toBe(['blog' => ['post-2' => 'Post 2']]); });