From fb05dbd70ae0d49a9ebcb58e7409b976a1a01c49 Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 4 Jul 2022 21:36:52 +0300 Subject: [PATCH] feat(core): update codebase for php 8.1 --- phpstan.neon | 1 + src/flextype/bootstrap/after-plugins.php | 2 + src/flextype/bootstrap/before-plugins.php | 2 + .../core/Cache/Drivers/Phparray/Config.php | 93 +------------ .../core/Cache/Drivers/Phparray/Driver.php | 130 ++++++++---------- .../core/Cache/Drivers/Phparray/Item.php | 40 +----- .../Commands/Cache/CacheClearCommand.php | 1 + .../Cache/CacheClearConfigCommand.php | 1 + .../Commands/Cache/CacheClearDataCommand.php | 1 + .../Cache/CacheClearRoutesCommand.php | 1 + .../Cache/CacheSetMultipleCommand.php | 1 + .../Commands/Entries/EntriesCreateCommand.php | 1 + .../Commands/Entries/EntriesFetchCommand.php | 1 + .../Commands/Entries/EntriesUpdateCommand.php | 1 + .../Commands/Tokens/TokensCreateCommand.php | 1 + .../Commands/Tokens/TokensFetchCommand.php | 1 + .../Commands/Tokens/TokensUpdateCommand.php | 1 + src/flextype/core/Console/FlextypeConsole.php | 4 +- src/flextype/core/Endpoints/Api.php | 1 - src/flextype/core/Endpoints/Cache.php | 2 +- src/flextype/core/Endpoints/Tokens.php | 2 +- .../Entries/Directives/MarkdownDirective.php | 1 + .../core/Entries/Directives/PhpDirective.php | 1 + .../Directives/ShortcodesDirective.php | 1 + .../Entries/Directives/TextileDirective.php | 1 + .../Entries/Directives/TypesDirective.php | 1 + src/flextype/core/Entries/Entries.php | 10 +- .../Expressions/FilesystemExpression.php | 1 + .../Entries/Expressions/StringsExpression.php | 1 + .../Entries/Expressions/UrlExpression.php | 6 +- .../Entries/Fields/Default/CreatedAtField.php | 3 + .../Entries/Fields/Default/CreatedByField.php | 2 + .../core/Entries/Fields/Default/IdField.php | 2 + .../Fields/Default/ModifiedAtField.php | 3 + .../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 | 1 + .../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 | 2 + .../core/Entries/Macros/PhpMacros.php | 2 + .../core/Entries/Macros/RegistryMacros.php | 2 + src/flextype/core/Parsers/Markdown.php | 4 +- src/flextype/core/Parsers/Shortcodes.php | 4 +- .../core/Parsers/Shortcodes/CalcShortcode.php | 2 +- .../Parsers/Shortcodes/ConstShortcode.php | 2 +- .../Parsers/Shortcodes/EntriesShortcode.php | 3 +- .../core/Parsers/Shortcodes/EvalShortcode.php | 2 +- .../Parsers/Shortcodes/FieldShortcode.php | 2 +- .../Shortcodes/FilesystemShortcode.php | 1 + .../core/Parsers/Shortcodes/I18nShortcode.php | 2 +- .../core/Parsers/Shortcodes/IfShortcode.php | 2 +- .../Parsers/Shortcodes/RegistryShortcode.php | 2 +- .../Parsers/Shortcodes/StringsShortcode.php | 5 +- .../core/Parsers/Shortcodes/TypeShortcode.php | 2 +- .../Parsers/Shortcodes/UnlessShortcode.php | 2 +- .../core/Parsers/Shortcodes/UrlShortcode.php | 2 +- .../core/Parsers/Shortcodes/UuidShortcode.php | 3 +- .../core/Parsers/Shortcodes/VarShortcode.php | 2 +- .../core/Parsers/Shortcodes/WhenShortcode.php | 2 +- src/flextype/core/Parsers/Textile.php | 4 +- src/flextype/core/Plugins.php | 4 +- src/flextype/core/Serializers/Frontmatter.php | 4 +- src/flextype/core/Serializers/Json.php | 2 +- src/flextype/core/Serializers/Json5.php | 2 +- src/flextype/core/Serializers/Neon.php | 2 +- src/flextype/core/Serializers/PhpArray.php | 3 +- src/flextype/core/Serializers/Yaml.php | 2 +- src/flextype/flextype.php | 24 +--- src/flextype/helpers/finder.php | 2 + src/flextype/helpers/upload.php | 2 + src/flextype/helpers/url.php | 3 +- src/flextype/routes/routes.php | 2 + src/flextype/settings.yaml | 18 --- tests/Pest.php | 2 + tests/src/flextype/HelpersTest.php | 2 + .../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 | 2 + .../Expressions/ConstExpressionTest.php | 2 + .../Expressions/CsrfExpressionTest.php | 3 + .../Expressions/EntriesExpressionTest.php | 1 + .../Expressions/FieldExpressionTest.php | 1 + .../Expressions/FilesystemExpressionTest.php | 1 + .../Expressions/I18nExpressionTest.php | 1 + .../Expressions/ParsersExpressionTest.php | 1 + .../Expressions/RegistryExpressionTest.php | 1 + .../Expressions/SerializersExpressionTest.php | 1 + .../Expressions/SlugifyExpressionTest.php | 1 + .../Expressions/StringsExpressionTest.php | 1 + .../Entries/Expressions/VarExpressionTest.php | 1 + .../Entries/Fields/CreatedAtFieldTest.php | 2 + .../Entries/Fields/CreatedByFieldTest.php | 2 + .../core/Entries/Fields/IdFieldTest.php | 2 + .../Entries/Fields/ModifiedAtFieldTest.php | 2 + .../Entries/Fields/PublishedAtFieldTest.php | 2 + .../Entries/Fields/PublishedByFieldTest.php | 2 + .../core/Entries/Fields/RoutableFieldTest.php | 2 + .../core/Entries/Fields/SlugFieldTest.php | 2 + .../core/Entries/Fields/UuidFieldTest.php | 1 + .../Entries/Fields/VisibilityFieldTest.php | 2 + .../core/Entries/Macros/EntriesMacrosTest.php | 2 + .../core/Entries/Macros/PhpMacrosTest.php | 2 + .../Entries/Macros/RegistryMacrosTest.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 | 2 + .../Shortcodes/MarkdownShortcodeTest.php | 2 + .../Parsers/Shortcodes/PhpShortcodeTest.php | 2 + .../Parsers/Shortcodes/RawShortcodeTest.php | 2 + .../Shortcodes/RegistryShortcodeTest.php | 2 + .../Shortcodes/StringsShortcodeTest.php | 2 + .../Shortcodes/TextileShortcodeTest.php | 2 + .../Parsers/Shortcodes/TypeShortcodeTest.php | 2 + .../Parsers/Shortcodes/UuidShortcodeTest.php | 2 + .../Parsers/Shortcodes/VarShortcodeTest.php | 2 + tests/src/flextype/core/PluginsTest.php | 1 + .../core/Serializers/FrontmatterTest.php | 2 + .../flextype/core/Serializers/NeonTest.php | 2 + .../core/Serializers/PhpArrayTest.php | 2 + 134 files changed, 282 insertions(+), 282 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index aa8255cc..17672ff1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,6 +4,7 @@ parameters: paths: - src ignoreErrors: + - '#Undefined variable: \$this.*#' - '/Constant PATH not found./' - '/Constant ROOT_DIR not found./' - '/Variable \$api_errors might not be defined./' diff --git a/src/flextype/bootstrap/after-plugins.php b/src/flextype/bootstrap/after-plugins.php index ffbd0adc..2c293f5b 100644 --- a/src/flextype/bootstrap/after-plugins.php +++ b/src/flextype/bootstrap/after-plugins.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + if (filesystem()->file(FLEXTYPE_PATH_PROJECT . '/bootstrap/after-plugins.php')->exists()) { require_once FLEXTYPE_PATH_PROJECT . '/bootstrap/after-plugins.php'; } \ No newline at end of file diff --git a/src/flextype/bootstrap/before-plugins.php b/src/flextype/bootstrap/before-plugins.php index e387b33c..1076671e 100644 --- a/src/flextype/bootstrap/before-plugins.php +++ b/src/flextype/bootstrap/before-plugins.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + if (filesystem()->file(FLEXTYPE_PATH_PROJECT . '/bootstrap/before-plugins.php')->exists()) { require_once FLEXTYPE_PATH_PROJECT . '/bootstrap/before-plugins.php'; } \ No newline at end of file diff --git a/src/flextype/core/Cache/Drivers/Phparray/Config.php b/src/flextype/core/Cache/Drivers/Phparray/Config.php index 4d991a42..dad6a9e7 100644 --- a/src/flextype/core/Cache/Drivers/Phparray/Config.php +++ b/src/flextype/core/Cache/Drivers/Phparray/Config.php @@ -14,103 +14,22 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +declare(strict_types=1); + namespace Phpfastcache\Drivers\Phparray; -use Phpfastcache\Config\ConfigurationOption; +use Phpfastcache\Config\IOConfigurationOptionInterface; +use Phpfastcache\Config\IOConfigurationOption; -class Config extends ConfigurationOption +class Config extends IOConfigurationOption implements IOConfigurationOptionInterface { - /** - * @var boolean - */ - protected $secureFileManipulation = false; - - /** - * @var bool - */ - protected $htaccess = true; - - /** - * @var string - */ - protected $securityKey = ''; - - /** - * @var string - */ - protected $cacheFileExtension = 'txt'; - - /** - * @return string - */ - public function getSecurityKey(): string - { - return $this->securityKey; - } - - /** - * @param string $securityKey - * @return Config - */ - public function setSecurityKey(string $securityKey): self - { - $this->securityKey = $securityKey; - - return $this; - } - - /** - * @return bool - */ - public function getHtaccess(): bool - { - return $this->htaccess; - } - - /** - * @param bool $htaccess - * @return Config - */ - public function setHtaccess(bool $htaccess): self - { - $this->htaccess = $htaccess; - - return $this; - } - - /** - * @return bool - */ - public function isSecureFileManipulation(): bool - { - return $this->secureFileManipulation; - } - - /** - * @param bool $secureFileManipulation - * @return self - */ - public function setSecureFileManipulation(bool $secureFileManipulation): self - { - $this->secureFileManipulation = $secureFileManipulation; - return $this; - } - - - /** - * @return string - */ - public function getCacheFileExtension(): string - { - return $this->cacheFileExtension; - } /** * @param string $cacheFileExtension * @return self * @throws PhpfastcacheInvalidConfigurationException */ - public function setCacheFileExtension(string $cacheFileExtension): self + public function setCacheFileExtension(string $cacheFileExtension): static { $this->cacheFileExtension = 'php'; return $this; diff --git a/src/flextype/core/Cache/Drivers/Phparray/Driver.php b/src/flextype/core/Cache/Drivers/Phparray/Driver.php index a10950ac..ee22ba93 100644 --- a/src/flextype/core/Cache/Drivers/Phparray/Driver.php +++ b/src/flextype/core/Cache/Drivers/Phparray/Driver.php @@ -19,41 +19,29 @@ namespace Phpfastcache\Drivers\Phparray; use Exception; use FilesystemIterator; use Phpfastcache\Cluster\AggregatablePoolInterface; -use Phpfastcache\Core\Pool\{DriverBaseTrait, ExtendedCacheItemPoolInterface, IO\IOHelperTrait}; -use Phpfastcache\Exceptions\{PhpfastcacheInvalidArgumentException, PhpfastcacheIOException}; +use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; +use Phpfastcache\Core\Pool\IO\IOHelperTrait; +use Phpfastcache\Core\Item\ExtendedCacheItemInterface; +use Phpfastcache\Exceptions\PhpfastcacheInvalidArgumentException; +use Phpfastcache\Exceptions\PhpfastcacheIOException; +use Phpfastcache\Exceptions\PhpfastcacheLogicException; use Phpfastcache\Util\Directory; -use Psr\Cache\CacheItemInterface; - /** - * Class Driver - * @package phpFastCache\Drivers - * @property Config $config Config object - * @method Config getConfig() Return the config object + * @method Config getConfig() * * Important NOTE: * We are using getKey instead of getEncodedKey since this backend create filename that are * managed by defaultFileNameHashFunction and not defaultKeyHashFunction */ -class Driver implements ExtendedCacheItemPoolInterface, AggregatablePoolInterface +class Driver implements AggregatablePoolInterface { use IOHelperTrait; - use DriverBaseTrait { - DriverBaseTrait::__construct as private __parentConstruct; - } - - /** - * Driver constructor. - * @param Config $config - * @param string $instanceId - */ - public function __construct(Config $config, string $instanceId) - { - $this->__parentConstruct($config, $instanceId); - } /** * @return bool + * @throws PhpfastcacheIOException + * @throws PhpfastcacheInvalidArgumentException */ public function driverCheck(): bool { @@ -69,81 +57,71 @@ class Driver implements ExtendedCacheItemPoolInterface, AggregatablePoolInterfac } /** - * @param CacheItemInterface $item - * @return null|array + * @param ExtendedCacheItemInterface $item + * @return ?array + * @throws PhpfastcacheIOException */ - protected function driverRead(CacheItemInterface $item) + protected function driverRead(ExtendedCacheItemInterface $item): ?array { - $file_path = $this->getFilePath($item->getKey(), true); + $filePath = $this->getFilePath($item->getKey(), true); - $value = null; - - set_error_handler(static function () {}); - - $value = include $file_path; - - restore_error_handler(); - - return $value; - } - - /** - * @param CacheItemInterface $item - * @return bool - * @throws PhpfastcacheInvalidArgumentException - */ - protected function driverWrite(CacheItemInterface $item): bool - { - /** - * Check for Cross-Driver type confusion - */ - if ($item instanceof Item) { - $file_path = $this->getFilePath($item->getKey()); - $data = $this->driverPreWrap($item); - - /** - * Force write - */ - try { - return $this->writefile($file_path, serializers()->phparray()->encode($data), $this->getConfig()->isSecureFileManipulation()); - } catch (Exception $e) { - return false; - } + try { + $content = $this->readFile($filePath); + } catch (PhpfastcacheIOException) { + return null; } - throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); + return $this->decode($content); } /** - * @param CacheItemInterface $item + * @param ExtendedCacheItemInterface $item * @return bool + * @throws PhpfastcacheIOException * @throws PhpfastcacheInvalidArgumentException + * @throws PhpfastcacheLogicException */ - protected function driverDelete(CacheItemInterface $item): bool + protected function driverWrite(ExtendedCacheItemInterface $item): bool { - /** - * Check for Cross-Driver type confusion - */ - if ($item instanceof Item) { - $file_path = $this->getFilePath($item->getKey(), true); - if (\file_exists($file_path) && @\unlink($file_path)) { - \clearstatcache(true, $file_path); - $dir = \dirname($file_path); - if (!(new FilesystemIterator($dir))->valid()) { - \rmdir($dir); - } - return true; - } + $this->assertCacheItemType($item, Item::class); + $filePath = $this->getFilePath($item->getKey()); + $data = $this->encode($this->driverPreWrap($item)); + + try { + return $this->writeFile($filePath, serializers()->phparray()->encode($data), $this->getConfig()->isSecureFileManipulation(), $this->getConfig()->isSecureFileManipulation()); + } catch (Exception) { return false; } + } - throw new PhpfastcacheInvalidArgumentException('Cross-Driver type confusion detected'); + /** + * @param ExtendedCacheItemInterface $item + * @return bool + * @throws PhpfastcacheIOException + * @throws PhpfastcacheInvalidArgumentException + */ + protected function driverDelete(ExtendedCacheItemInterface $item): bool + { + $this->assertCacheItemType($item, Item::class); + + $filePath = $this->getFilePath($item->getKey(), true); + if (\file_exists($filePath) && @\unlink($filePath)) { + \clearstatcache(true, $filePath); + $dir = \dirname($filePath); + if (!(new FilesystemIterator($dir))->valid()) { + \rmdir($dir); + } + return true; + } + + return false; } /** * @return bool * @throws \Phpfastcache\Exceptions\PhpfastcacheIOException + * @throws PhpfastcacheInvalidArgumentException */ protected function driverClear(): bool { diff --git a/src/flextype/core/Cache/Drivers/Phparray/Item.php b/src/flextype/core/Cache/Drivers/Phparray/Item.php index 5ccbee5b..14c819c8 100644 --- a/src/flextype/core/Cache/Drivers/Phparray/Item.php +++ b/src/flextype/core/Cache/Drivers/Phparray/Item.php @@ -16,45 +16,15 @@ declare(strict_types=1); namespace Phpfastcache\Drivers\Phparray; -use Phpfastcache\Core\Item\{ExtendedCacheItemInterface, ItemBaseTrait}; -use Phpfastcache\Core\Pool\ExtendedCacheItemPoolInterface; -use Phpfastcache\Drivers\Phparray\Driver as PhparrayDriver; -use Phpfastcache\Exceptions\{PhpfastcacheInvalidArgumentException}; +use Phpfastcache\Core\Item\ExtendedCacheItemInterface; +use Phpfastcache\Core\Item\TaggableCacheItemTrait; -/** - * Class Item - * @package phpFastCache\Drivers\Phparray - */ class Item implements ExtendedCacheItemInterface { - use ItemBaseTrait { - ItemBaseTrait::__construct as __BaseConstruct; - } + use TaggableCacheItemTrait; - /** - * Item constructor. - * @param Driver $driver - * @param $key - * @throws PhpfastcacheInvalidArgumentException - */ - public function __construct(PhparrayDriver $driver, $key) + protected function getDriverClass(): string { - $this->__BaseConstruct($driver, $key); - } - - /** - * @param ExtendedCacheItemPoolInterface $driver - * @return static - * @throws PhpfastcacheInvalidArgumentException - */ - public function setDriver(ExtendedCacheItemPoolInterface $driver) - { - if ($driver instanceof PhparrayDriver) { - $this->driver = $driver; - - return $this; - } - - throw new PhpfastcacheInvalidArgumentException('Invalid driver instance'); + return Driver::class; } } \ No newline at end of file diff --git a/src/flextype/core/Console/Commands/Cache/CacheClearCommand.php b/src/flextype/core/Console/Commands/Cache/CacheClearCommand.php index 3431e5c9..1cd3a45e 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheClearCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheClearCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; use function Thermage\div; use function Thermage\renderToString; +use function Glowy\Filesystem\filesystem; class CacheClearCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheClearConfigCommand.php b/src/flextype/core/Console/Commands/Cache/CacheClearConfigCommand.php index 6ee21790..ea1bcac4 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheClearConfigCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheClearConfigCommand.php @@ -22,6 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; use function Thermage\div; use function Thermage\renderToString; +use function Glowy\Filesystem\filesystem; class CacheClearConfigCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheClearDataCommand.php b/src/flextype/core/Console/Commands/Cache/CacheClearDataCommand.php index fbd6dfee..c145915b 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheClearDataCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheClearDataCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Console\Input\InputOption; use function Thermage\div; use function Thermage\renderToString; +use function Glowy\Filesystem\filesystem; class CacheClearDataCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheClearRoutesCommand.php b/src/flextype/core/Console/Commands/Cache/CacheClearRoutesCommand.php index 29edcdf7..6b53e571 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheClearRoutesCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheClearRoutesCommand.php @@ -23,6 +23,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Console\Input\InputOption; use function Thermage\div; use function Thermage\renderToString; +use function Glowy\Filesystem\filesystem; class CacheClearRoutesCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php b/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php index 0b1681ea..03775acf 100644 --- a/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.php +++ b/src/flextype/core/Console/Commands/Cache/CacheSetMultipleCommand.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 Glowy\Strings\strings; class CacheSetMultipleCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php index 25eb01f1..d8cf9bc3 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesCreateCommand.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 Glowy\Strings\strings; class EntriesCreateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php index c99e6498..3340c75c 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesFetchCommand.php @@ -26,6 +26,7 @@ use Symfony\Component\Console\Helper\Table; use function Thermage\div; use function Thermage\span; use function Thermage\renderToString; +use function Glowy\Strings\strings; class EntriesFetchCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php b/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php index df5016f2..09da285f 100644 --- a/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.php +++ b/src/flextype/core/Console/Commands/Entries/EntriesUpdateCommand.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 Glowy\Strings\strings; 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 f29a7e4f..93eb2db7 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensCreateCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensCreateCommand.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 Glowy\Strings\strings; class TokensCreateCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php index 51a9b862..6736281d 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensFetchCommand.php @@ -26,6 +26,7 @@ use Symfony\Component\Console\Helper\Table; use function Thermage\div; use function Thermage\span; use function Thermage\renderToString; +use function Glowy\Strings\strings; class TokensFetchCommand extends Command { diff --git a/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php b/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php index fa01a5a5..2bcd495e 100644 --- a/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.php +++ b/src/flextype/core/Console/Commands/Tokens/TokensUpdateCommand.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 Glowy\Strings\strings; class TokensUpdateCommand extends Command { diff --git a/src/flextype/core/Console/FlextypeConsole.php b/src/flextype/core/Console/FlextypeConsole.php index 003aab32..be2048b8 100644 --- a/src/flextype/core/Console/FlextypeConsole.php +++ b/src/flextype/core/Console/FlextypeConsole.php @@ -51,7 +51,7 @@ use Symfony\Component\Console\Output\OutputInterface; class FlextypeConsole extends ConsoleApplication { - public function run(InputInterface $input = null, OutputInterface $output = null) + public function run(InputInterface $input = null, OutputInterface $output = null): int { // Add Console Commands console()->add(new AboutCommand()); @@ -82,6 +82,6 @@ class FlextypeConsole extends ConsoleApplication console()->add(new TokensHasCommand()); console()->add(new TokensFetchCommand()); - parent::run(); + return parent::run(); } } \ No newline at end of file diff --git a/src/flextype/core/Endpoints/Api.php b/src/flextype/core/Endpoints/Api.php index 9fd5b84e..1cdceb49 100644 --- a/src/flextype/core/Endpoints/Api.php +++ b/src/flextype/core/Endpoints/Api.php @@ -26,7 +26,6 @@ use function is_string; use function password_verify; use function registry; use function serializers; -use function tokens; class Api { diff --git a/src/flextype/core/Endpoints/Cache.php b/src/flextype/core/Endpoints/Cache.php index a6e2cbff..fc7353df 100644 --- a/src/flextype/core/Endpoints/Cache.php +++ b/src/flextype/core/Endpoints/Cache.php @@ -20,7 +20,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use function count; -use function filesystem; +use function Glowy\Filesystem\filesystem; class Cache extends Api { diff --git a/src/flextype/core/Endpoints/Tokens.php b/src/flextype/core/Endpoints/Tokens.php index 440fe50b..58d48686 100644 --- a/src/flextype/core/Endpoints/Tokens.php +++ b/src/flextype/core/Endpoints/Tokens.php @@ -20,7 +20,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use function count; -use function filesystem; +use function Glowy\Filesystem\filesystem; class Tokens extends Api { diff --git a/src/flextype/core/Entries/Directives/MarkdownDirective.php b/src/flextype/core/Entries/Directives/MarkdownDirective.php index 93c55de9..447e4ace 100644 --- a/src/flextype/core/Entries/Directives/MarkdownDirective.php +++ b/src/flextype/core/Entries/Directives/MarkdownDirective.php @@ -15,6 +15,7 @@ declare(strict_types=1); */ use Glowy\Arrays\Arrays as Collection; +use function Glowy\Strings\strings; // 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 a5dee428..41a6eeb3 100644 --- a/src/flextype/core/Entries/Directives/PhpDirective.php +++ b/src/flextype/core/Entries/Directives/PhpDirective.php @@ -15,6 +15,7 @@ declare(strict_types=1); */ use Glowy\Arrays\Arrays as Collection; +use function Glowy\Strings\strings; // 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 fcb56deb..9b874d06 100644 --- a/src/flextype/core/Entries/Directives/ShortcodesDirective.php +++ b/src/flextype/core/Entries/Directives/ShortcodesDirective.php @@ -15,6 +15,7 @@ declare(strict_types=1); */ use Glowy\Arrays\Arrays as Collection; +use function Glowy\Strings\strings; // 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 29d86e29..1122cc81 100644 --- a/src/flextype/core/Entries/Directives/TextileDirective.php +++ b/src/flextype/core/Entries/Directives/TextileDirective.php @@ -15,6 +15,7 @@ declare(strict_types=1); */ use Glowy\Arrays\Arrays as Collection; +use function Glowy\Strings\strings; // 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 47619f48..861a5356 100644 --- a/src/flextype/core/Entries/Directives/TypesDirective.php +++ b/src/flextype/core/Entries/Directives/TypesDirective.php @@ -15,6 +15,7 @@ declare(strict_types=1); */ use Glowy\Arrays\Arrays as Collection; +use function Glowy\Strings\strings; // 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 4f8faecb..37163c49 100755 --- a/src/flextype/core/Entries/Entries.php +++ b/src/flextype/core/Entries/Entries.php @@ -20,18 +20,18 @@ use Glowy\Arrays\Arrays as Collection; use Glowy\Macroable\Macroable; use function array_merge; -use function arrays; +use function Glowy\Arrays\arrays; use function cache; use function count; use function emitter; use function file_exists; -use function filesystem; -use function filter; +use function Glowy\Filesystem\filesystem; +use function filterCollection; use function find; use function is_array; -use function registry; +use function Glowy\Registry\registry; use function serializers; -use function strings; +use function Glowy\Strings\strings; class Entries { diff --git a/src/flextype/core/Entries/Expressions/FilesystemExpression.php b/src/flextype/core/Entries/Expressions/FilesystemExpression.php index 50620ed0..7f3f636b 100644 --- a/src/flextype/core/Entries/Expressions/FilesystemExpression.php +++ b/src/flextype/core/Entries/Expressions/FilesystemExpression.php @@ -20,6 +20,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; use Symfony\Component\Finder\Finder; use Glowy\Arrays\Arrays as Collection; +use function Glowy\Filesystem\filesystem; use Glowy\Macroable\Macroable; class FilesystemExpression implements ExpressionFunctionProviderInterface diff --git a/src/flextype/core/Entries/Expressions/StringsExpression.php b/src/flextype/core/Entries/Expressions/StringsExpression.php index 3be50b9f..d14db4d6 100644 --- a/src/flextype/core/Entries/Expressions/StringsExpression.php +++ b/src/flextype/core/Entries/Expressions/StringsExpression.php @@ -16,6 +16,7 @@ declare(strict_types=1); namespace Flextype\Entries\Expressions; +use function Glowy\Strings\strings; use Symfony\Component\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; diff --git a/src/flextype/core/Entries/Expressions/UrlExpression.php b/src/flextype/core/Entries/Expressions/UrlExpression.php index 15a50143..218a8e26 100644 --- a/src/flextype/core/Entries/Expressions/UrlExpression.php +++ b/src/flextype/core/Entries/Expressions/UrlExpression.php @@ -25,9 +25,9 @@ class UrlExpression implements ExpressionFunctionProviderInterface { 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('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()), diff --git a/src/flextype/core/Entries/Fields/Default/CreatedAtField.php b/src/flextype/core/Entries/Fields/Default/CreatedAtField.php index 2686f53c..9d346ef5 100644 --- a/src/flextype/core/Entries/Fields/Default/CreatedAtField.php +++ b/src/flextype/core/Entries/Fields/Default/CreatedAtField.php @@ -14,6 +14,9 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; +use function Glowy\Filesystem\filesystem; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/CreatedByField.php b/src/flextype/core/Entries/Fields/Default/CreatedByField.php index 88ab8e67..f4a0ad5e 100644 --- a/src/flextype/core/Entries/Fields/Default/CreatedByField.php +++ b/src/flextype/core/Entries/Fields/Default/CreatedByField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesCreate', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/IdField.php b/src/flextype/core/Entries/Fields/Default/IdField.php index 9bb774ee..a6aa42cd 100644 --- a/src/flextype/core/Entries/Fields/Default/IdField.php +++ b/src/flextype/core/Entries/Fields/Default/IdField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php b/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php index 6aa1d67f..3d9f04bd 100644 --- a/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php +++ b/src/flextype/core/Entries/Fields/Default/ModifiedAtField.php @@ -14,6 +14,9 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; +use function Glowy\Filesystem\filesystem; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/PublishedAtField.php b/src/flextype/core/Entries/Fields/Default/PublishedAtField.php index 8b8bbd36..31d46cb9 100644 --- a/src/flextype/core/Entries/Fields/Default/PublishedAtField.php +++ b/src/flextype/core/Entries/Fields/Default/PublishedAtField.php @@ -14,6 +14,9 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; +use function Glowy\Filesystem\filesystem; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/PublishedByField.php b/src/flextype/core/Entries/Fields/Default/PublishedByField.php index dc2b8227..4a9fe2fe 100644 --- a/src/flextype/core/Entries/Fields/Default/PublishedByField.php +++ b/src/flextype/core/Entries/Fields/Default/PublishedByField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesCreate', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/RoutableField.php b/src/flextype/core/Entries/Fields/Default/RoutableField.php index 8da74640..b5e9ed1f 100644 --- a/src/flextype/core/Entries/Fields/Default/RoutableField.php +++ b/src/flextype/core/Entries/Fields/Default/RoutableField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/SlugField.php b/src/flextype/core/Entries/Fields/Default/SlugField.php index 676f6072..3997747d 100644 --- a/src/flextype/core/Entries/Fields/Default/SlugField.php +++ b/src/flextype/core/Entries/Fields/Default/SlugField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Default/UuidField.php b/src/flextype/core/Entries/Fields/Default/UuidField.php index e38fad9f..ea90ac76 100644 --- a/src/flextype/core/Entries/Fields/Default/UuidField.php +++ b/src/flextype/core/Entries/Fields/Default/UuidField.php @@ -15,6 +15,7 @@ declare(strict_types=1); */ use Ramsey\Uuid\Uuid; +use function Glowy\Strings\strings; 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 48fd37a1..70830ba5 100644 --- a/src/flextype/core/Entries/Fields/Default/VisibilityField.php +++ b/src/flextype/core/Entries/Fields/Default/VisibilityField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php b/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php index 4a21c18d..ad7a9706 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/CallsField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesCreate', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php b/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php index a2e8171a..7e40cb8a 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/IdField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php b/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php index f8a88979..2b195f68 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/LimitCallsField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesCreate', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php b/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php index 438bf45d..3534ed53 100644 --- a/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php +++ b/src/flextype/core/Entries/Fields/Tokens/Items/StateField.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Strings\strings; + emitter()->addListener('onEntriesCreate', static function (): void { // Determine is the current field is set and enabled. diff --git a/src/flextype/core/Entries/Macros/EntriesMacros.php b/src/flextype/core/Entries/Macros/EntriesMacros.php index 07e179af..2df66384 100644 --- a/src/flextype/core/Entries/Macros/EntriesMacros.php +++ b/src/flextype/core/Entries/Macros/EntriesMacros.php @@ -16,6 +16,8 @@ declare(strict_types=1); use Glowy\Arrays\Arrays as Collection; +use function Glowy\Registry\registry; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { if (! registry()->get('flextype.settings.entries.macros.entries.enabled')) { diff --git a/src/flextype/core/Entries/Macros/PhpMacros.php b/src/flextype/core/Entries/Macros/PhpMacros.php index 46610443..d147e119 100644 --- a/src/flextype/core/Entries/Macros/PhpMacros.php +++ b/src/flextype/core/Entries/Macros/PhpMacros.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Registry\registry; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { if (! registry()->get('flextype.settings.entries.macros.php.enabled')) { return; diff --git a/src/flextype/core/Entries/Macros/RegistryMacros.php b/src/flextype/core/Entries/Macros/RegistryMacros.php index 647931c9..1673cee7 100644 --- a/src/flextype/core/Entries/Macros/RegistryMacros.php +++ b/src/flextype/core/Entries/Macros/RegistryMacros.php @@ -14,6 +14,8 @@ declare(strict_types=1); * Redistributions of files must retain the above copyright notice. */ +use function Glowy\Registry\registry; + emitter()->addListener('onEntriesFetchSingleHasResult', static function (): void { if (! registry()->get('flextype.settings.entries.macros.registry.enabled')) { diff --git a/src/flextype/core/Parsers/Markdown.php b/src/flextype/core/Parsers/Markdown.php index 6c97cfc2..1b3a65f0 100644 --- a/src/flextype/core/Parsers/Markdown.php +++ b/src/flextype/core/Parsers/Markdown.php @@ -24,8 +24,8 @@ use League\CommonMark\Extension\Table\TableExtension; use League\CommonMark\MarkdownConverter; use function cache; -use function registry; -use function strings; +use function Glowy\Registry\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 bd9a8800..f7d43177 100644 --- a/src/flextype/core/Parsers/Shortcodes.php +++ b/src/flextype/core/Parsers/Shortcodes.php @@ -26,8 +26,8 @@ use function cache; use function count; use function file_exists; use function is_array; -use function registry; -use function strings; +use function Glowy\Registry\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 82e3de10..773383da 100644 --- a/src/flextype/core/Parsers/Shortcodes/CalcShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/CalcShortcode.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function registry; +use function Glowy\Registry\registry; use function expression; // Shortcode: calc diff --git a/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php b/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php index 00137f65..e805c7d7 100644 --- a/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function registry; +use function Glowy\Registry\registry; // 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 d7232396..271f621b 100644 --- a/src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/EntriesShortcode.php @@ -21,7 +21,8 @@ use Flextype\Entries\Entries; use function entries; use function parsers; -use function registry; +use function Glowy\Registry\registry; +use function Glowy\Strings\strings; // Shortcode: entries // Usage: (entries fetch:'blog/post-1' field:'title') diff --git a/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php b/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php index 0d428c2a..7e890e22 100644 --- a/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/EvalShortcode.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function registry; +use function Glowy\Registry\registry; use function expression; // Shortcode: eval diff --git a/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php b/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php index 9298df3c..5cfe30ec 100644 --- a/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/FieldShortcode.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function registry; +use function Glowy\Registry\registry; // Shortcode: field // Usage: (field:title) diff --git a/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php b/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php index 22ca1772..e4ce0d71 100644 --- a/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/FilesystemShortcode.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; +use function Glowy\Filesystem\filesystem; // 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 cf2da804..39ca2dce 100644 --- a/src/flextype/core/Parsers/Shortcodes/I18nShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/I18nShortcode.php @@ -19,7 +19,7 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use function parsers; -use function registry; +use function Glowy\Registry\registry; // 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 fadfbae2..000e714b 100644 --- a/src/flextype/core/Parsers/Shortcodes/IfShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/IfShortcode.php @@ -20,7 +20,7 @@ use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use function parsers; -use function registry; +use function Glowy\Registry\registry; // Shortcode: if // Usage: (if:'(var:score) < (var:level1)') Show something... (/if) diff --git a/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php b/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php index 59a36f94..ccfc0146 100644 --- a/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/RegistryShortcode.php @@ -19,7 +19,7 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use function parsers; -use function registry; +use function Glowy\Registry\registry; // 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 8e48271a..28e9305b 100644 --- a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php @@ -18,7 +18,8 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use function parsers; -use function registry; +use function Glowy\Registry\registry; +use function Glowy\Strings\strings; // Shortcode: strings // Usage: (strings) strings to modify (/strings) @@ -188,7 +189,7 @@ parsers()->shortcodes()->addHandler('strings', static function (ShortcodeInterfa } if ($key == 'increment') { - $content = strings($content)->{'increment'}(isset($vars[0]) ? (int) $vars[0] : 1, isset($vars[1]) ? (string) $vars[1] : '_')->toString(); + $content = strings($content)->{'increment'}(isset($vars[1]) ? (string) $vars[1] : '_', isset($vars[0]) ? (int) $vars[0] : 1)->toString(); } if ($key == 'indexOf') { diff --git a/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php b/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php index 3d1d3072..95d5b21e 100644 --- a/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/TypeShortcode.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function registry; +use function Glowy\Registry\registry; // Shortcode: type // Usage: (type:string) diff --git a/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php b/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php index 145b230e..e8d83428 100644 --- a/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/UnlessShortcode.php @@ -20,7 +20,7 @@ use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use function parsers; -use function registry; +use function Glowy\Registry\registry; // 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 42b40209..8fc105cc 100644 --- a/src/flextype/core/Parsers/Shortcodes/UrlShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/UrlShortcode.php @@ -19,7 +19,7 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use function app; use function parsers; -use function registry; +use function Glowy\Registry\registry; // Shortcode: getBaseUrl // Usage: (getBaseUrl) diff --git a/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php b/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php index f7635bc1..44682538 100644 --- a/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/UuidShortcode.php @@ -19,7 +19,8 @@ namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Ramsey\Uuid\Uuid; use function parsers; -use function registry; +use function Glowy\Registry\registry; +use function Glowy\Strings\strings; // Shortcode: uuid // Usage: (uuid) (uuid:4) diff --git a/src/flextype/core/Parsers/Shortcodes/VarShortcode.php b/src/flextype/core/Parsers/Shortcodes/VarShortcode.php index 975ea499..a8caa9df 100644 --- a/src/flextype/core/Parsers/Shortcodes/VarShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/VarShortcode.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Parsers\Shortcodes; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -use function registry; +use function Glowy\Registry\registry; // Shortcode: var // Usage: (var:foo) diff --git a/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php b/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php index d35219d8..3d603272 100644 --- a/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/WhenShortcode.php @@ -20,7 +20,7 @@ use Thunder\Shortcode\Shortcode\ShortcodeInterface; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; use function parsers; -use function registry; +use function Glowy\Registry\registry; // 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 f44190b7..72e5c68c 100644 --- a/src/flextype/core/Parsers/Textile.php +++ b/src/flextype/core/Parsers/Textile.php @@ -20,8 +20,8 @@ use Exception; use Netcarver\Textile\Parser; use function cache; -use function registry; -use function strings; +use function Glowy\Registry\registry; +use function Glowy\Strings\strings; final class Textile { diff --git a/src/flextype/core/Plugins.php b/src/flextype/core/Plugins.php index 2d91d4ca..5c372aa8 100755 --- a/src/flextype/core/Plugins.php +++ b/src/flextype/core/Plugins.php @@ -23,10 +23,10 @@ use RuntimeException; use function array_diff_key; use function array_replace_recursive; -use function arrays; +use function Glowy\Arrays\arrays; use function count; use function filemtime; -use function filesystem; +use function Glowy\Filesystem\filesystem; use function flextype; use function is_array; use function md5; diff --git a/src/flextype/core/Serializers/Frontmatter.php b/src/flextype/core/Serializers/Frontmatter.php index b18f56f9..6e7b72e5 100644 --- a/src/flextype/core/Serializers/Frontmatter.php +++ b/src/flextype/core/Serializers/Frontmatter.php @@ -17,7 +17,7 @@ declare(strict_types=1); namespace Flextype\Serializers; use function array_slice; -use function arrays; +use function Glowy\Arrays\arrays; use function cache; use function count; use function implode; @@ -27,7 +27,7 @@ use function preg_replace; use function preg_split; use function registry; use function serializers; -use function strings; +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 c7d9d26d..64b45896 100644 --- a/src/flextype/core/Serializers/Json.php +++ b/src/flextype/core/Serializers/Json.php @@ -25,7 +25,7 @@ use function json_encode; use function json_last_error; use function json_last_error_msg; use function registry; -use function strings; +use function Glowy\Strings\strings; use const JSON_PRESERVE_ZERO_FRACTION; use const JSON_PRETTY_PRINT; diff --git a/src/flextype/core/Serializers/Json5.php b/src/flextype/core/Serializers/Json5.php index a2769cc3..70607951 100644 --- a/src/flextype/core/Serializers/Json5.php +++ b/src/flextype/core/Serializers/Json5.php @@ -25,7 +25,7 @@ use function json_encode; use function json_last_error; use function json_last_error_msg; use function registry; -use function strings; +use function Glowy\Strings\strings; use const JSON_PRESERVE_ZERO_FRACTION; use const JSON_PRETTY_PRINT; diff --git a/src/flextype/core/Serializers/Neon.php b/src/flextype/core/Serializers/Neon.php index 2ca009e6..e04d7cc7 100644 --- a/src/flextype/core/Serializers/Neon.php +++ b/src/flextype/core/Serializers/Neon.php @@ -22,7 +22,7 @@ use RuntimeException; use function cache; use function registry; -use function strings; +use function Glowy\Strings\strings; class Neon { diff --git a/src/flextype/core/Serializers/PhpArray.php b/src/flextype/core/Serializers/PhpArray.php index c42f2b4e..aa29fbc8 100644 --- a/src/flextype/core/Serializers/PhpArray.php +++ b/src/flextype/core/Serializers/PhpArray.php @@ -19,10 +19,11 @@ namespace Flextype\Serializers; use Symfony\Component\VarExporter\VarExporter; use RuntimeException; +use Exception; use function cache; use function registry; -use function strings; +use function Glowy\Strings\strings; use function var_export; class PhpArray diff --git a/src/flextype/core/Serializers/Yaml.php b/src/flextype/core/Serializers/Yaml.php index 11aaba18..17fe1c66 100644 --- a/src/flextype/core/Serializers/Yaml.php +++ b/src/flextype/core/Serializers/Yaml.php @@ -27,7 +27,7 @@ use function function_exists; use function ini_get; use function ini_set; use function registry; -use function strings; +use function Glowy\Strings\strings; class Yaml { diff --git a/src/flextype/flextype.php b/src/flextype/flextype.php index 1002f0ab..af567f35 100644 --- a/src/flextype/flextype.php +++ b/src/flextype/flextype.php @@ -62,7 +62,7 @@ use function emitter; use function extension_loaded; use function file_exists; use function filemtime; -use function filesystem; +use function Glowy\Filesystem\filesystem; use function flextype; use function function_exists; use function implode; @@ -74,9 +74,9 @@ use function md5; use function parsers; use function plugins; use function register_shutdown_function; -use function registry; +use function Glowy\Registry\registry; use function session; -use function strings; +use function Glowy\Strings\strings; use function sys_get_temp_dir; use function trim; use function var_export; @@ -268,24 +268,9 @@ container()->set('cache', static function () { case 'cassandra': $config = new \Phpfastcache\Drivers\Cassandra\Config(getDriverConfig($driverName)); break; - case 'cookie': - $config = new \Phpfastcache\Drivers\Cookie\Config(getDriverConfig($driverName)); - break; - case 'couchbase': - $config = new \Phpfastcache\Drivers\Couchbase\Config(getDriverConfig($driverName)); - break; - case 'couchdb': - $config = new \Phpfastcache\Drivers\Couchdb\Config(getDriverConfig($driverName)); - break; - case 'devfalse': - $config = new \Phpfastcache\Drivers\Devfalse\Config(getDriverConfig($driverName)); - break; case 'devnull': $config = new \Phpfastcache\Drivers\Devnull\Config(getDriverConfig($driverName)); break; - case 'devtrue': - $config = new \Phpfastcache\Drivers\Devtrue\Config(getDriverConfig($driverName)); - break; case 'files': $config = new \Phpfastcache\Drivers\Files\Config(getDriverConfig($driverName)); break; @@ -313,9 +298,6 @@ container()->set('cache', static function () { case 'redis': $config = new \Phpfastcache\Drivers\Redis\Config(getDriverConfig($driverName)); break; - case 'riak': - $config = new \Phpfastcache\Drivers\Riak\Config(getDriverConfig($driverName)); - break; case 'sqlite': $config = new \Phpfastcache\Drivers\Sqlite\Config(getDriverConfig($driverName)); break; diff --git a/src/flextype/helpers/finder.php b/src/flextype/helpers/finder.php index c2d7d500..8c107fac 100644 --- a/src/flextype/helpers/finder.php +++ b/src/flextype/helpers/finder.php @@ -4,6 +4,8 @@ declare(strict_types=1); use Symfony\Component\Finder\Finder; +use function Glowy\Filesystem\filesystem; + if (! function_exists('find')) { /** * Create a Finder instance with predefined filter params or without them. diff --git a/src/flextype/helpers/upload.php b/src/flextype/helpers/upload.php index c2db8ef3..20d9d313 100644 --- a/src/flextype/helpers/upload.php +++ b/src/flextype/helpers/upload.php @@ -4,6 +4,8 @@ declare(strict_types=1); use Sirius\Upload\Handler as UploadHandler; use Sirius\Upload\Result\File as UploadResultFile; +use function Glowy\Strings\strings; +use function Glowy\Filesystem\filesystem; if (! function_exists('upload')) { /** diff --git a/src/flextype/helpers/url.php b/src/flextype/helpers/url.php index 94cbe1d6..c6449795 100644 --- a/src/flextype/helpers/url.php +++ b/src/flextype/helpers/url.php @@ -4,8 +4,9 @@ declare(strict_types=1); use Slim\Interfaces\RouteParserInterface; use Psr\Http\Message\UriInterface; -use Psr\Http\Message\ServerRequestInterface as Request; +use Psr\Http\Message\ServerRequestInterface; use Slim\Psr7\Response; +use function Glowy\Strings\strings; if (! function_exists('urlFor')) { /** diff --git a/src/flextype/routes/routes.php b/src/flextype/routes/routes.php index 7cadd2d2..01821bc0 100644 --- a/src/flextype/routes/routes.php +++ b/src/flextype/routes/routes.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + // Add endpoints routes require_once __DIR__ . '/endpoints/tokens.php'; require_once __DIR__ . '/endpoints/cache.php'; diff --git a/src/flextype/settings.yaml b/src/flextype/settings.yaml index c5185736..0a95be50 100644 --- a/src/flextype/settings.yaml +++ b/src/flextype/settings.yaml @@ -313,17 +313,6 @@ cache: ssl_enabled: false ssl_verify: false default_ttl: 900 - cookie: - aware_of_untrustable_data: false - limited_memory_by_object: 4096 - default_ttl: 900 - couchbase: - host: '127.0.0.1' - port: 8091 - username: '' - password: '' - bucket_name: default - default_ttl: 900 couchdb: database: 'flextype' path: '/' @@ -336,8 +325,6 @@ cache: timeout: 10 default_ttl: 900 devnull: {} - devfalse: {} - devtrue: {} phparray: path: '/data' security_key: 'auto' @@ -401,11 +388,6 @@ cache: database: 0 opt_prefix: '' default_ttl: 900 - riak: - host: '127.0.0.1' - port: 8098 - prefix: 'riak' - default_ttl: 900 sqlite: path: '/data' security_key: auto diff --git a/tests/Pest.php b/tests/Pest.php index df5ec0b4..23d7f18e 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace Flextype; +use function Glowy\Filesystem\filesystem; + define('ROOT_DIR', str_replace(DIRECTORY_SEPARATOR, '/', getcwd())); /** diff --git a/tests/src/flextype/HelpersTest.php b/tests/src/flextype/HelpersTest.php index 85576a28..bdf4c0c4 100644 --- a/tests/src/flextype/HelpersTest.php +++ b/tests/src/flextype/HelpersTest.php @@ -18,6 +18,8 @@ use Monolog\Logger; use Glowy\Csrf\Csrf; use Cocur\Slugify\Slugify; use Glowy\Arrays\Arrays; +use function Glowy\Filesystem\filesystem; +use function Glowy\Strings\strings; beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php b/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php index 64b6679a..1f89e8c6 100644 --- a/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/ExpressionsDirectiveTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 4546a5d9..04720ae7 100644 --- a/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/MarkdownDirectiveTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 76f18f5b..cc8640ac 100644 --- a/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/PhpDirectiveTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 370904d9..38e914ac 100644 --- a/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/ShortcodesDirectiveTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 865341ce..767bb4a9 100644 --- a/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/TextileDirectiveTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 2c16dbe3..09f25749 100644 --- a/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php +++ b/tests/src/flextype/core/Entries/Directives/TypesDirectiveTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 52843160..a525b4b7 100644 --- a/tests/src/flextype/core/Entries/EntriesTest.php +++ b/tests/src/flextype/core/Entries/EntriesTest.php @@ -3,6 +3,8 @@ use Glowy\Arrays\Arrays; use Flextype\Entries\Entries; +use function Glowy\Filesystem\filesystem; + 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 98f018a8..01f21be8 100644 --- a/tests/src/flextype/core/Entries/Expressions/ActionsExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/ActionsExpressionTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 2c916312..5ad46d62 100644 --- a/tests/src/flextype/core/Entries/Expressions/CollectionExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/CollectionExpressionTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 1b2d8eeb..3ab0e98a 100644 --- a/tests/src/flextype/core/Entries/Expressions/ConstExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/ConstExpressionTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 ef4e82e2..bae56d5b 100644 --- a/tests/src/flextype/core/Entries/Expressions/CsrfExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/CsrfExpressionTest.php @@ -2,6 +2,9 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; +use function Glowy\Strings\strings; + 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 c2a558c3..875e6744 100644 --- a/tests/src/flextype/core/Entries/Expressions/EntriesExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/EntriesExpressionTest.php @@ -1,6 +1,7 @@ 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 467cd628..fa6b1d7d 100644 --- a/tests/src/flextype/core/Entries/Expressions/FieldExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/FieldExpressionTest.php @@ -1,6 +1,7 @@ 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 2ea02dc3..6da1a7b4 100644 --- a/tests/src/flextype/core/Entries/Expressions/FilesystemExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/FilesystemExpressionTest.php @@ -1,6 +1,7 @@ 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 c1c3cd7a..2bca9314 100644 --- a/tests/src/flextype/core/Entries/Expressions/I18nExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/I18nExpressionTest.php @@ -1,6 +1,7 @@ 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 14eecbc4..22688346 100644 --- a/tests/src/flextype/core/Entries/Expressions/ParsersExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/ParsersExpressionTest.php @@ -1,6 +1,7 @@ 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 ed4a9b70..9a6b8588 100644 --- a/tests/src/flextype/core/Entries/Expressions/RegistryExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/RegistryExpressionTest.php @@ -1,6 +1,7 @@ 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 f1668136..198bf3c6 100644 --- a/tests/src/flextype/core/Entries/Expressions/SerializersExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/SerializersExpressionTest.php @@ -1,6 +1,7 @@ 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 a77caaff..8d3b8cb3 100644 --- a/tests/src/flextype/core/Entries/Expressions/SlugifyExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/SlugifyExpressionTest.php @@ -1,6 +1,7 @@ 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 1f9a4f36..53b242b1 100644 --- a/tests/src/flextype/core/Entries/Expressions/StringsExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/StringsExpressionTest.php @@ -1,6 +1,7 @@ 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 fa54b9f2..50844b50 100644 --- a/tests/src/flextype/core/Entries/Expressions/VarExpressionTest.php +++ b/tests/src/flextype/core/Entries/Expressions/VarExpressionTest.php @@ -1,6 +1,7 @@ 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 64c1d620..32561755 100644 --- a/tests/src/flextype/core/Entries/Fields/CreatedAtFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/CreatedAtFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 fa81c190..0be171b6 100644 --- a/tests/src/flextype/core/Entries/Fields/CreatedByFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/CreatedByFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 1b8b0be9..217f23c5 100644 --- a/tests/src/flextype/core/Entries/Fields/IdFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/IdFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 d06328b9..18a2277d 100644 --- a/tests/src/flextype/core/Entries/Fields/ModifiedAtFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/ModifiedAtFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 19206c74..bb26479c 100644 --- a/tests/src/flextype/core/Entries/Fields/PublishedAtFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/PublishedAtFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 60e47c94..c00c41b5 100644 --- a/tests/src/flextype/core/Entries/Fields/PublishedByFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/PublishedByFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 f721a5b6..eb3ca628 100644 --- a/tests/src/flextype/core/Entries/Fields/RoutableFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/RoutableFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 87d5dc48..9e1a9ab3 100644 --- a/tests/src/flextype/core/Entries/Fields/SlugFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/SlugFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 608ca318..262ae26c 100644 --- a/tests/src/flextype/core/Entries/Fields/UuidFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/UuidFieldTest.php @@ -2,6 +2,7 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; use Respect\Validation\Validator as v; beforeEach(function() { diff --git a/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php b/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php index 36a19cbe..4695b624 100644 --- a/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php +++ b/tests/src/flextype/core/Entries/Fields/VisibilityFieldTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 1cb4d7b6..6151dfca 100644 --- a/tests/src/flextype/core/Entries/Macros/EntriesMacrosTest.php +++ b/tests/src/flextype/core/Entries/Macros/EntriesMacrosTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 d141dbb4..73d211d5 100644 --- a/tests/src/flextype/core/Entries/Macros/PhpMacrosTest.php +++ b/tests/src/flextype/core/Entries/Macros/PhpMacrosTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + 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 40bf9d6a..2006bbb9 100644 --- a/tests/src/flextype/core/Entries/Macros/RegistryMacrosTest.php +++ b/tests/src/flextype/core/Entries/Macros/RegistryMacrosTest.php @@ -2,6 +2,8 @@ use Flextype\Component\Filesystem\Filesystem; +use function Glowy\Filesystem\filesystem; + beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->create(); }); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php index 8e748620..c0d32f81 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/CalcShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 4dc06735..4d5c2181 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/ConstShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/ConstShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 e2017790..d459ae2b 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/EntriesShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/EntriesShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 7737ca5c..cf32cee6 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/EvalShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/EvalShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 502cd872..89d99760 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/FieldShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/FieldShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 a0bfb153..d501d678 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/FilesystemShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/FilesystemShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + beforeEach(function (): void { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php index 9b4b984e..22291530 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/MarkdownShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 fcb75227..d2f8114a 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/PhpShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/PhpShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 8a0f5f36..d47b5efe 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/RawShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/RawShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 f8b1125e..8e669a7b 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/RegistryShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/RegistryShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Strings\strings; + test('registry shortcode', function () { expect(strings(parsers()->shortcodes()->parse("(registry get id:'flextype.manifest')"))->isJson())->toBeTrue(); expect(parsers()->shortcodes()->parse("(registry get id:'flextype.manifest.name')"))->toBe('Flextype'); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php index b57c78a3..b1b48294 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Strings\strings; + test('strings shortcode', function () { // lower diff --git a/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php index f6e8e558..a013604b 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/TextileShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + 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 3d315397..64840a76 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/TypeShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/TypeShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); }); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php index cd0c5f9d..db4337b7 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/UuidShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Strings\strings; + test('uuid shortcode', function () { expect(strings(parsers()->shortcodes()->parse('(uuid)'))->length() > 0)->toBeTrue(); expect(strings(parsers()->shortcodes()->parse('(uuid:4)'))->length() > 0)->toBeTrue(); diff --git a/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php index e60da764..4ad29d4c 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/VarShortcodeTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + beforeEach(function() { filesystem()->directory(FLEXTYPE_PATH_PROJECT . '/entries')->ensureExists(0755, true); }); diff --git a/tests/src/flextype/core/PluginsTest.php b/tests/src/flextype/core/PluginsTest.php index 0260972d..d4593570 100644 --- a/tests/src/flextype/core/PluginsTest.php +++ b/tests/src/flextype/core/PluginsTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); use Flextype\Flextype; use Glowy\Strings\Strings; +use function Glowy\Filesystem\filesystem; beforeEach(function() { // Create sandbox plugin diff --git a/tests/src/flextype/core/Serializers/FrontmatterTest.php b/tests/src/flextype/core/Serializers/FrontmatterTest.php index 5efa5587..dc09bd42 100644 --- a/tests/src/flextype/core/Serializers/FrontmatterTest.php +++ b/tests/src/flextype/core/Serializers/FrontmatterTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + test('encode', function () { $string = filesystem()->file(ROOT_DIR . '/tests/fixtures/serializers/frontmatter.md')->get(); $this->assertEquals($string, diff --git a/tests/src/flextype/core/Serializers/NeonTest.php b/tests/src/flextype/core/Serializers/NeonTest.php index 27b6603d..ca466ebd 100644 --- a/tests/src/flextype/core/Serializers/NeonTest.php +++ b/tests/src/flextype/core/Serializers/NeonTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Filesystem\filesystem; + test('encode', function () { $string = filesystem()->file(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 eccb7513..7cb69b00 100644 --- a/tests/src/flextype/core/Serializers/PhpArrayTest.php +++ b/tests/src/flextype/core/Serializers/PhpArrayTest.php @@ -2,6 +2,8 @@ declare(strict_types=1); +use function Glowy\Strings\strings; + test('encode', function () { $this->assertEquals(65, strings(serializers()->phparray()->encode(['title' => 'Foo', 'content' => 'Bar']))->length());