From 7b294f99c6396efa8d7254d4a1c39b12c16b3b91 Mon Sep 17 00:00:00 2001 From: Thomas Skerbis Date: Mon, 30 Oct 2023 16:25:04 +0100 Subject: [PATCH 1/2] vendor updates --- composer.lock | 75 ++-- vendor/autoload.php | 18 + vendor/composer/ClassLoader.php | 204 ++++++++-- vendor/composer/InstalledVersions.php | 359 ++++++++++++++++++ vendor/composer/autoload_classmap.php | 3 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_real.php | 30 +- vendor/composer/autoload_static.php | 1 + vendor/composer/installed.json | 296 ++++++++------- vendor/composer/installed.php | 41 ++ vendor/composer/platform_check.php | 26 ++ vendor/doctrine/cache/README.md | 8 +- vendor/doctrine/cache/UPGRADE-1.11.md | 15 + .../cache/{UPGRADE.md => UPGRADE-1.4.md} | 0 vendor/doctrine/cache/composer.json | 14 +- .../lib/Doctrine/Common/Cache/ApcCache.php | 3 +- .../lib/Doctrine/Common/Cache/ApcuCache.php | 2 + .../lib/Doctrine/Common/Cache/ArrayCache.php | 4 +- .../cache/lib/Doctrine/Common/Cache/Cache.php | 2 +- .../Doctrine/Common/Cache/CacheProvider.php | 20 +- .../lib/Doctrine/Common/Cache/ChainCache.php | 5 +- .../Common/Cache/CouchbaseBucketCache.php | 7 +- .../Doctrine/Common/Cache/CouchbaseCache.php | 1 + .../Doctrine/Common/Cache/ExtMongoDBCache.php | 9 +- .../lib/Doctrine/Common/Cache/FileCache.php | 27 +- .../Doctrine/Common/Cache/FilesystemCache.php | 5 +- .../Doctrine/Common/Cache/InvalidCacheId.php | 19 +- .../Common/Cache/LegacyMongoDBCache.php | 12 +- .../Doctrine/Common/Cache/MemcacheCache.php | 3 +- .../Doctrine/Common/Cache/MemcachedCache.php | 3 + .../Doctrine/Common/Cache/MongoDBCache.php | 6 +- .../Doctrine/Common/Cache/MultiPutCache.php | 6 +- .../Doctrine/Common/Cache/PhpFileCache.php | 6 +- .../lib/Doctrine/Common/Cache/PredisCache.php | 6 +- .../Common/Cache/Psr6/CacheAdapter.php | 340 +++++++++++++++++ .../Doctrine/Common/Cache/Psr6/CacheItem.php | 118 ++++++ .../Common/Cache/Psr6/DoctrineProvider.php | 135 +++++++ .../Common/Cache/Psr6/InvalidArgument.php | 13 + .../Common/Cache/Psr6/TypedCacheItem.php | 99 +++++ .../lib/Doctrine/Common/Cache/RedisCache.php | 7 +- .../Doctrine/Common/Cache/SQLite3Cache.php | 24 +- .../lib/Doctrine/Common/Cache/Version.php | 3 + .../lib/Doctrine/Common/Cache/VoidCache.php | 2 + .../Doctrine/Common/Cache/WinCacheCache.php | 2 + .../lib/Doctrine/Common/Cache/XcacheCache.php | 4 +- .../Doctrine/Common/Cache/ZendDataCache.php | 2 + .../spatie/calendar-links/.github/FUNDING.yml | 1 - .../.github/ISSUE_TEMPLATE/01-bug_report.md | 23 -- .../ISSUE_TEMPLATE/02-feature_request.md | 17 - .../.github/PULL_REQUEST_TEMPLATE.md | 9 - .../calendar-links/.github/dependabot.yml | 7 - .../backward-compatibility-check.yml | 12 - .../calendar-links/.github/workflows/ci.yml | 38 -- .../.github/workflows/php-cs-fixer.yml | 27 -- .../.github/workflows/psalm.yml | 33 -- .../{.php_cs => .php-cs-fixer.php} | 18 +- vendor/spatie/calendar-links/CHANGELOG.md | 53 ++- vendor/spatie/calendar-links/CONTRIBUTING.md | 55 --- vendor/spatie/calendar-links/README.md | 32 +- vendor/spatie/calendar-links/composer.json | 12 +- .../spatie/calendar-links/psalm-baseline.xml | 36 ++ vendor/spatie/calendar-links/psalm.xml | 21 +- .../src/Exceptions/InvalidLink.php | 8 + .../src/Generators/BaseOutlook.php | 56 +++ .../calendar-links/src/Generators/Google.php | 9 + .../calendar-links/src/Generators/Ics.php | 27 +- .../src/Generators/WebOffice.php | 14 + .../src/Generators/WebOutlook.php | 63 +-- .../calendar-links/src/Generators/Yahoo.php | 43 +-- vendor/spatie/calendar-links/src/Link.php | 27 +- 71 files changed, 1999 insertions(+), 631 deletions(-) create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/installed.php create mode 100644 vendor/composer/platform_check.php create mode 100644 vendor/doctrine/cache/UPGRADE-1.11.md rename vendor/doctrine/cache/{UPGRADE.md => UPGRADE-1.4.md} (100%) create mode 100644 vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php create mode 100644 vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php create mode 100644 vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php create mode 100644 vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php create mode 100644 vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/TypedCacheItem.php delete mode 100644 vendor/spatie/calendar-links/.github/FUNDING.yml delete mode 100644 vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/01-bug_report.md delete mode 100644 vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/02-feature_request.md delete mode 100644 vendor/spatie/calendar-links/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 vendor/spatie/calendar-links/.github/dependabot.yml delete mode 100644 vendor/spatie/calendar-links/.github/workflows/backward-compatibility-check.yml delete mode 100644 vendor/spatie/calendar-links/.github/workflows/ci.yml delete mode 100644 vendor/spatie/calendar-links/.github/workflows/php-cs-fixer.yml delete mode 100644 vendor/spatie/calendar-links/.github/workflows/psalm.yml rename vendor/spatie/calendar-links/{.php_cs => .php-cs-fixer.php} (67%) delete mode 100644 vendor/spatie/calendar-links/CONTRIBUTING.md create mode 100644 vendor/spatie/calendar-links/psalm-baseline.xml create mode 100644 vendor/spatie/calendar-links/src/Generators/BaseOutlook.php create mode 100644 vendor/spatie/calendar-links/src/Generators/WebOffice.php diff --git a/composer.lock b/composer.lock index dba0a97..824f230 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "doctrine/cache", - "version": "1.10.2", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" + "reference": "56cd022adb5514472cb144c087393c1821911d09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", + "url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09", + "reference": "56cd022adb5514472cb144c087393c1821911d09", "shasum": "" }, "require": { @@ -28,20 +28,19 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" @@ -86,29 +85,48 @@ "redis", "xcache" ], - "time": "2020-07-07T18:54:01+00:00" + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/1.13.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2022-05-20T20:06:54+00:00" }, { "name": "spatie/calendar-links", - "version": "1.4.3", + "version": "1.8.5", "source": { "type": "git", "url": "https://github.com/spatie/calendar-links.git", - "reference": "f2ebf9b376e0f473a36ec20e7ce12b8e6805e5ec" + "reference": "d6f6c5e7ff916e2a55e2160d4db4f15875cb6e07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/calendar-links/zipball/f2ebf9b376e0f473a36ec20e7ce12b8e6805e5ec", - "reference": "f2ebf9b376e0f473a36ec20e7ce12b8e6805e5ec", + "url": "https://api.github.com/repos/spatie/calendar-links/zipball/d6f6c5e7ff916e2a55e2160d4db4f15875cb6e07", + "reference": "d6f6c5e7ff916e2a55e2160d4db4f15875cb6e07", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.0", - "spatie/phpunit-snapshot-assertions": "^3.0|^4.0", - "vimeo/psalm": "^4.1" + "friendsofphp/php-cs-fixer": "^3.14", + "phpunit/phpunit": "^9.6 || ^10.0", + "spatie/phpunit-snapshot-assertions": "^4.2 || ^5.0", + "vimeo/psalm": "^5.6" }, "type": "library", "autoload": { @@ -134,7 +152,17 @@ "calendar-links", "spatie" ], - "time": "2021-03-05T09:07:44+00:00" + "support": { + "issues": "https://github.com/spatie/calendar-links/issues", + "source": "https://github.com/spatie/calendar-links/tree/1.8.5" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2023-03-02T16:05:13+00:00" } ], "packages-dev": [], @@ -144,5 +172,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.3.0" } diff --git a/vendor/autoload.php b/vendor/autoload.php index 3da09f9..e41149f 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit20ad14021163bfacb3f9280be1ddc67c::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index fce8549..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -37,57 +37,126 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + // PSR-4 + /** + * @var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var list + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ private $prefixesPsr0 = array(); + /** + * @var list + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var array + */ private $missingClasses = array(); + + /** @var string|null */ private $apcuPrefix; + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } + /** + * @return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return list + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return list + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return array Array of classname => path + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param array $classMap Class to filename map + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,22 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -126,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -147,25 +219,28 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -175,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -195,8 +270,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +288,12 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +313,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +337,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +359,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,33 +381,55 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } + + return null; } /** @@ -367,6 +474,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -432,14 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php new file mode 100644 index 0000000..51e734a --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index ef84b8a..151e8ae 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,10 +2,11 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Definition\\DefinitionMergeInterface' => $vendorDir . '/lib/Definition/DefinitionMergeInterface.php', 'Definition\\DefinitionProvider' => $vendorDir . '/lib/Definition/DefinitionProvider.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index a741f89..35855ec 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index eaa255d..f42c945 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -13,37 +13,23 @@ public static function loadClassLoader($class) } } + /** + * @return \Composer\Autoload\ClassLoader + */ public static function getLoader() { if (null !== self::$loader) { return self::$loader; } + require __DIR__ . '/platform_check.php'; + spl_autoload_register(array('ComposerAutoloaderInit20ad14021163bfacb3f9280be1ddc67c', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit20ad14021163bfacb3f9280be1ddc67c', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit20ad14021163bfacb3f9280be1ddc67c::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit20ad14021163bfacb3f9280be1ddc67c::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 4db5a35..fc00f5c 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -29,6 +29,7 @@ class ComposerStaticInit20ad14021163bfacb3f9280be1ddc67c ); public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'Definition\\DefinitionMergeInterface' => __DIR__ . '/..' . '/lib/Definition/DefinitionMergeInterface.php', 'Definition\\DefinitionProvider' => __DIR__ . '/..' . '/lib/Definition/DefinitionProvider.php', ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b6166e7..dcd53ad 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,136 +1,170 @@ -[ - { - "name": "doctrine/cache", - "version": "1.10.2", - "version_normalized": "1.10.2.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" - }, - "time": "2020-07-07T18:54:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" +{ + "packages": [ + { + "name": "doctrine/cache", + "version": "1.13.0", + "version_normalized": "1.13.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "56cd022adb5514472cb144c087393c1821911d09" }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09", + "reference": "56cd022adb5514472cb144c087393c1821911d09", + "shasum": "" }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "require": { + "php": "~7.1 || ^8.0" }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "conflict": { + "doctrine/common": ">2.2,<2.4" }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ] - }, - { - "name": "spatie/calendar-links", - "version": "1.4.3", - "version_normalized": "1.4.3.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/calendar-links.git", - "reference": "f2ebf9b376e0f473a36ec20e7ce12b8e6805e5ec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/calendar-links/zipball/f2ebf9b376e0f473a36ec20e7ce12b8e6805e5ec", - "reference": "f2ebf9b376e0f473a36ec20e7ce12b8e6805e5ec", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.0", - "spatie/phpunit-snapshot-assertions": "^3.0|^4.0", - "vimeo/psalm": "^4.1" - }, - "time": "2021-03-05T09:07:44+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Spatie\\CalendarLinks\\": "src" - } + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^9", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "time": "2022-05-20T20:06:54+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/1.13.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "install-path": "../doctrine/cache" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sebastian De Deyne", - "email": "sebastian@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Generate add to calendar links for Google, iCal and other calendar systems", - "homepage": "https://github.com/spatie/calendar-links", - "keywords": [ - "calendar-links", - "spatie" - ] - } -] + { + "name": "spatie/calendar-links", + "version": "1.8.5", + "version_normalized": "1.8.5.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/calendar-links.git", + "reference": "d6f6c5e7ff916e2a55e2160d4db4f15875cb6e07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/calendar-links/zipball/d6f6c5e7ff916e2a55e2160d4db4f15875cb6e07", + "reference": "d6f6c5e7ff916e2a55e2160d4db4f15875cb6e07", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.14", + "phpunit/phpunit": "^9.6 || ^10.0", + "spatie/phpunit-snapshot-assertions": "^4.2 || ^5.0", + "vimeo/psalm": "^5.6" + }, + "time": "2023-03-02T16:05:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Spatie\\CalendarLinks\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sebastian De Deyne", + "email": "sebastian@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Generate add to calendar links for Google, iCal and other calendar systems", + "homepage": "https://github.com/spatie/calendar-links", + "keywords": [ + "calendar-links", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/calendar-links/issues", + "source": "https://github.com/spatie/calendar-links/tree/1.8.5" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "install-path": "../spatie/calendar-links" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 0000000..a08df43 --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,41 @@ + array( + 'name' => '__root__', + 'pretty_version' => '7.4.0.x-dev', + 'version' => '7.4.0.9999999-dev', + 'reference' => '8278ac168d24342c481de76ce5b02a7424dfbf45', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => '7.4.0.x-dev', + 'version' => '7.4.0.9999999-dev', + 'reference' => '8278ac168d24342c481de76ce5b02a7424dfbf45', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'doctrine/cache' => array( + 'pretty_version' => '1.13.0', + 'version' => '1.13.0.0', + 'reference' => '56cd022adb5514472cb144c087393c1821911d09', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'spatie/calendar-links' => array( + 'pretty_version' => '1.8.5', + 'version' => '1.8.5.0', + 'reference' => 'd6f6c5e7ff916e2a55e2160d4db4f15875cb6e07', + 'type' => 'library', + 'install_path' => __DIR__ . '/../spatie/calendar-links', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 0000000..adfb472 --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 80000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/vendor/doctrine/cache/README.md b/vendor/doctrine/cache/README.md index c795a05..a13196d 100644 --- a/vendor/doctrine/cache/README.md +++ b/vendor/doctrine/cache/README.md @@ -1,9 +1,13 @@ # Doctrine Cache -[![Build Status](https://img.shields.io/travis/doctrine/cache/master.svg?style=flat-square)](http://travis-ci.org/doctrine/cache) -[![Code Coverage](https://codecov.io/gh/doctrine/dbal/branch/cache/graph/badge.svg)](https://codecov.io/gh/doctrine/dbal/branch/master) +[![Build Status](https://github.com/doctrine/cache/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/cache/actions) +[![Code Coverage](https://codecov.io/gh/doctrine/cache/branch/1.10.x/graph/badge.svg)](https://codecov.io/gh/doctrine/cache/branch/1.10.x) [![Latest Stable Version](https://img.shields.io/packagist/v/doctrine/cache.svg?style=flat-square)](https://packagist.org/packages/doctrine/cache) [![Total Downloads](https://img.shields.io/packagist/dt/doctrine/cache.svg?style=flat-square)](https://packagist.org/packages/doctrine/cache) Cache component extracted from the Doctrine Common project. [Documentation](https://www.doctrine-project.org/projects/doctrine-cache/en/current/index.html) + +This library is deprecated and will no longer receive bug fixes from the +Doctrine Project. Please use a different cache library, preferably PSR-6 or +PSR-16 instead. diff --git a/vendor/doctrine/cache/UPGRADE-1.11.md b/vendor/doctrine/cache/UPGRADE-1.11.md new file mode 100644 index 0000000..a33be23 --- /dev/null +++ b/vendor/doctrine/cache/UPGRADE-1.11.md @@ -0,0 +1,15 @@ +# Upgrade to 1.11 + +doctrine/cache will no longer be maintained and all cache implementations have +been marked as deprecated. These implementations will be removed in 2.0, which +will only contain interfaces to provide a lightweight package for backward +compatibility. + +There are two new classes to use in the `Doctrine\Common\Cache\Psr6` namespace: +* The `CacheAdapter` class allows using any Doctrine Cache as PSR-6 cache. This + is useful to provide a forward compatibility layer in libraries that accept + Doctrine cache implementations and switch to PSR-6. +* The `DoctrineProvider` class allows using any PSR-6 cache as Doctrine cache. + This implementation is designed for libraries that leak the cache and want to + switch to allowing PSR-6 implementations. This class is design to be used + during the transition phase of sunsetting doctrine/cache support. diff --git a/vendor/doctrine/cache/UPGRADE.md b/vendor/doctrine/cache/UPGRADE-1.4.md similarity index 100% rename from vendor/doctrine/cache/UPGRADE.md rename to vendor/doctrine/cache/UPGRADE-1.4.md diff --git a/vendor/doctrine/cache/composer.json b/vendor/doctrine/cache/composer.json index b889aa3..bd337f9 100644 --- a/vendor/doctrine/cache/composer.json +++ b/vendor/doctrine/cache/composer.json @@ -28,9 +28,13 @@ "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "predis/predis": "~1.0", - "doctrine/coding-standard": "^6.0" + "doctrine/coding-standard": "^9", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "cache/integration-tests": "dev-master", + "symfony/cache": "^4.4 || ^5.4 || ^6", + "symfony/var-exporter": "^4.4 || ^5.4 || ^6" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" @@ -44,9 +48,9 @@ "autoload-dev": { "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" } }, - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true } } } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php index 138d49a..742dff2 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcCache.php @@ -2,7 +2,6 @@ namespace Doctrine\Common\Cache; -use const PHP_VERSION_ID; use function apc_cache_info; use function apc_clear_cache; use function apc_delete; @@ -11,6 +10,8 @@ use function apc_sma_info; use function apc_store; +use const PHP_VERSION_ID; + /** * APC cache provider. * diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php index a725213..afb501d 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ApcuCache.php @@ -14,6 +14,8 @@ /** * APCu cache provider. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class ApcuCache extends CacheProvider diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php index 1beb709..eca43b8 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ArrayCache.php @@ -7,11 +7,13 @@ /** * Array cache driver. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class ArrayCache extends CacheProvider { - /** @var array[] $data each element being a tuple of [$data, $expiration], where the expiration is int|bool */ + /** @psalm-var array> $data each element being a tuple of [$data, $expiration], where the expiration is int|bool */ private $data = []; /** @var int */ diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php index 4569744..4cfab6c 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php @@ -84,7 +84,7 @@ public function delete($id); * - memory_available * Memory allowed to use for storage. * - * @return array|null An associative array with server's statistics if available, NULL otherwise. + * @return mixed[]|null An associative array with server's statistics if available, NULL otherwise. */ public function getStats(); } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php index 43d414f..180482a 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php @@ -171,7 +171,7 @@ public function deleteAll() * * @return string The namespaced id. */ - private function getNamespacedId(string $id) : string + private function getNamespacedId(string $id): string { $namespaceVersion = $this->getNamespaceVersion(); @@ -181,7 +181,7 @@ private function getNamespacedId(string $id) : string /** * Returns the namespace cache key. */ - private function getNamespaceCacheKey() : string + private function getNamespaceCacheKey(): string { return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); } @@ -189,7 +189,7 @@ private function getNamespaceCacheKey() : string /** * Returns the namespace version. */ - private function getNamespaceVersion() : int + private function getNamespaceVersion(): int { if ($this->namespaceVersion !== null) { return $this->namespaceVersion; @@ -204,9 +204,9 @@ private function getNamespaceVersion() : int /** * Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it. * - * @param array $keys Array of keys to retrieve from cache + * @param string[] $keys Array of keys to retrieve from cache * - * @return array Array of values retrieved for the given keys. + * @return mixed[] Array of values retrieved for the given keys. */ protected function doFetchMultiple(array $keys) { @@ -245,9 +245,9 @@ abstract protected function doContains($id); /** * Default implementation of doSaveMultiple. Each driver that supports multi-put should override it. * - * @param array $keysAndValues Array of keys and values to save in cache - * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these - * cache entries (0 => infinite lifeTime). + * @param mixed[] $keysAndValues Array of keys and values to save in cache + * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these + * cache entries (0 => infinite lifeTime). * * @return bool TRUE if the operation was successful, FALSE if it wasn't. */ @@ -281,7 +281,7 @@ abstract protected function doSave($id, $data, $lifeTime = 0); /** * Default implementation of doDeleteMultiple. Each driver that supports multi-delete should override it. * - * @param array $keys Array of keys to delete from cache + * @param string[] $keys Array of keys to delete from cache * * @return bool TRUE if the operation was successful, FALSE if it wasn't */ @@ -319,7 +319,7 @@ abstract protected function doFlush(); /** * Retrieves cached information from the data store. * - * @return array|null An associative array with server's statistics if available, NULL otherwise. + * @return mixed[]|null An associative array with server's statistics if available, NULL otherwise. */ abstract protected function doGetStats(); } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php index 8f85845..a5b4261 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ChainCache.php @@ -3,12 +3,15 @@ namespace Doctrine\Common\Cache; use Traversable; + use function array_values; use function count; use function iterator_to_array; /** * Cache provider that allows to easily chain multiple cache providers + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class ChainCache extends CacheProvider { @@ -28,7 +31,7 @@ public function __construct($cacheProviders = []) : array_values($cacheProviders); } - public function setDefaultLifeTimeForDownstreamCacheProviders(int $defaultLifeTimeForDownstreamCacheProviders) : void + public function setDefaultLifeTimeForDownstreamCacheProviders(int $defaultLifeTimeForDownstreamCacheProviders): void { $this->defaultLifeTimeForDownstreamCacheProviders = $defaultLifeTimeForDownstreamCacheProviders; } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseBucketCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseBucketCache.php index b27720c..ebaad7e 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseBucketCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseBucketCache.php @@ -8,6 +8,7 @@ use Couchbase\Document; use Couchbase\Exception; use RuntimeException; + use function phpversion; use function serialize; use function sprintf; @@ -18,6 +19,8 @@ /** * Couchbase ^2.3.0 cache provider. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ final class CouchbaseBucketCache extends CacheProvider { @@ -170,7 +173,7 @@ protected function doGetStats() ]; } - private function normalizeKey(string $id) : string + private function normalizeKey(string $id): string { $normalized = substr($id, 0, self::MAX_KEY_LENGTH); @@ -186,7 +189,7 @@ private function normalizeKey(string $id) : string * * @src https://developer.couchbase.com/documentation/server/4.1/developer-guide/expiry.html */ - private function normalizeExpiry(int $expiry) : int + private function normalizeExpiry(int $expiry): int { if ($expiry > self::THIRTY_DAYS_IN_SECONDS) { return time() + $expiry; diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php index 2c62c2e..63a60f4 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CouchbaseCache.php @@ -3,6 +3,7 @@ namespace Doctrine\Common\Cache; use Couchbase; + use function explode; use function time; diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ExtMongoDBCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ExtMongoDBCache.php index b06f862..b20f913 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ExtMongoDBCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ExtMongoDBCache.php @@ -11,6 +11,7 @@ use MongoDB\Database; use MongoDB\Driver\Exception\Exception; use MongoDB\Model\BSONDocument; + use function serialize; use function time; use function unserialize; @@ -18,7 +19,7 @@ /** * MongoDB cache provider for ext-mongodb * - * @internal Do not use - will be removed in 2.0. Use MongoDBCache instead + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class ExtMongoDBCache extends CacheProvider { @@ -100,7 +101,7 @@ protected function doSave($id, $data, $lifeTime = 0) ['_id' => $id], [ '$set' => [ - MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000): null), + MongoDBCache::EXPIRATION_FIELD => ($lifeTime > 0 ? new UTCDateTime((time() + $lifeTime) * 1000) : null), MongoDBCache::DATA_FIELD => new Binary(serialize($data), Binary::TYPE_GENERIC), ], ], @@ -180,14 +181,14 @@ protected function doGetStats() /** * Check if the document is expired. */ - private function isExpired(BSONDocument $document) : bool + private function isExpired(BSONDocument $document): bool { return isset($document[MongoDBCache::EXPIRATION_FIELD]) && $document[MongoDBCache::EXPIRATION_FIELD] instanceof UTCDateTime && $document[MongoDBCache::EXPIRATION_FIELD]->toDateTime() < new DateTime(); } - private function createExpirationIndex() : void + private function createExpirationIndex(): void { if ($this->expirationIndexCreated) { return; diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php index 4b48520..1d7fd4e 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php @@ -7,8 +7,8 @@ use Iterator; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; -use const DIRECTORY_SEPARATOR; -use const PATHINFO_DIRNAME; +use SplFileInfo; + use function bin2hex; use function chmod; use function defined; @@ -32,8 +32,13 @@ use function tempnam; use function unlink; +use const DIRECTORY_SEPARATOR; +use const PATHINFO_DIRNAME; + /** * Base file cache driver. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ abstract class FileCache extends CacheProvider { @@ -66,6 +71,7 @@ abstract class FileCache extends CacheProvider /** * @param string $directory The cache directory. * @param string $extension The cache file extension. + * @param int $umask * * @throws InvalidArgumentException */ @@ -78,6 +84,7 @@ public function __construct($directory, $extension = '', $umask = 0002) gettype($umask) )); } + $this->umask = $umask; if (! $this->createPathIfNeeded($directory)) { @@ -133,7 +140,8 @@ protected function getFilename($id) $hash = hash('sha256', $id); // This ensures that the filename is unique and that there are no invalid chars in it. - if ($id === '' + if ( + $id === '' || ((strlen($id) * 2 + $this->extensionStringLength) > 255) || ($this->isRunningOnWindows && ($this->directoryStringLength + 4 + strlen($id) * 2 + $this->extensionStringLength) > 258) ) { @@ -216,7 +224,7 @@ protected function doGetStats() * * @return bool TRUE on success or if path already exists, FALSE if path cannot be created. */ - private function createPathIfNeeded(string $path) : bool + private function createPathIfNeeded(string $path): bool { if (! is_dir($path)) { if (@mkdir($path, 0777 & (~$this->umask), true) === false && ! is_dir($path)) { @@ -235,7 +243,7 @@ private function createPathIfNeeded(string $path) : bool * * @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error. */ - protected function writeFile(string $filename, string $content) : bool + protected function writeFile(string $filename, string $content): bool { $filepath = pathinfo($filename, PATHINFO_DIRNAME); @@ -262,7 +270,10 @@ protected function writeFile(string $filename, string $content) : bool return false; } - private function getIterator() : Iterator + /** + * @return Iterator + */ + private function getIterator(): Iterator { return new RecursiveIteratorIterator( new RecursiveDirectoryIterator($this->directory, FilesystemIterator::SKIP_DOTS), @@ -273,9 +284,9 @@ private function getIterator() : Iterator /** * @param string $name The filename */ - private function isFilenameEndingWithExtension(string $name) : bool + private function isFilenameEndingWithExtension(string $name): bool { return $this->extension === '' - || strrpos($name, $this->extension) === (strlen($name) - $this->extensionStringLength); + || strrpos($name, $this->extension) === strlen($name) - $this->extensionStringLength; } } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php index 8f34c9c..832e389 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php @@ -2,7 +2,6 @@ namespace Doctrine\Common\Cache; -use const PHP_EOL; use function fclose; use function fgets; use function fopen; @@ -11,8 +10,12 @@ use function time; use function unserialize; +use const PHP_EOL; + /** * Filesystem cache driver. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class FilesystemCache extends FileCache { diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/InvalidCacheId.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/InvalidCacheId.php index 0a7fe65..ac6e0f0 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/InvalidCacheId.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/InvalidCacheId.php @@ -4,21 +4,34 @@ namespace Doctrine\Common\Cache; use InvalidArgumentException; + use function sprintf; +/** + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + */ final class InvalidCacheId extends InvalidArgumentException { - public static function exceedsMaxLength($id, int $maxLength) : self + /** + * @param mixed $id + */ + public static function exceedsMaxLength($id, int $maxLength): self { return new self(sprintf('Cache id "%s" exceeds maximum length %d', $id, $maxLength)); } - public static function containsUnauthorizedCharacter($id, string $character) : self + /** + * @param mixed $id + */ + public static function containsUnauthorizedCharacter($id, string $character): self { return new self(sprintf('Cache id "%s" contains unauthorized character "%s"', $id, $character)); } - public static function containsControlCharacter($id) : self + /** + * @param mixed $id + */ + public static function containsControlCharacter($id): self { return new self(sprintf('Cache id "%s" contains at least one control character', $id)); } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/LegacyMongoDBCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/LegacyMongoDBCache.php index fe5dc4b..b557abb 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/LegacyMongoDBCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/LegacyMongoDBCache.php @@ -6,16 +6,18 @@ use MongoCollection; use MongoCursorException; use MongoDate; -use const E_USER_DEPRECATED; + use function serialize; use function time; use function trigger_error; use function unserialize; +use const E_USER_DEPRECATED; + /** * MongoDB cache provider. * - * @internal Do not use - will be removed in 2.0. Use MongoDBCache instead + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class LegacyMongoDBCache extends CacheProvider { @@ -154,16 +156,16 @@ protected function doGetStats() /** * Check if the document is expired. * - * @param array $document + * @param mixed[] $document */ - private function isExpired(array $document) : bool + private function isExpired(array $document): bool { return isset($document[MongoDBCache::EXPIRATION_FIELD]) && $document[MongoDBCache::EXPIRATION_FIELD] instanceof MongoDate && $document[MongoDBCache::EXPIRATION_FIELD]->sec < time(); } - private function createExpirationIndex() : void + private function createExpirationIndex(): void { if ($this->expirationIndexCreated) { return; diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php index 42bbd2c..b86b6a6 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcacheCache.php @@ -3,12 +3,13 @@ namespace Doctrine\Common\Cache; use Memcache; + use function time; /** * Memcache cache provider. * - * @deprecated + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 * * @link www.doctrine-project.org */ diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php index da966ae..4261209 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MemcachedCache.php @@ -3,6 +3,7 @@ namespace Doctrine\Common\Cache; use Memcached; + use function array_keys; use function preg_match; use function strlen; @@ -12,6 +13,8 @@ /** * Memcached cache provider. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class MemcachedCache extends CacheProvider diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php index 861e4dd..562e66c 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MongoDBCache.php @@ -5,11 +5,15 @@ use InvalidArgumentException; use MongoCollection; use MongoDB\Collection; -use const E_USER_DEPRECATED; + use function trigger_error; +use const E_USER_DEPRECATED; + /** * MongoDB cache provider. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class MongoDBCache extends CacheProvider { diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php index 6f059c1..b7c06d3 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/MultiPutCache.php @@ -14,9 +14,9 @@ interface MultiPutCache /** * Returns a boolean value indicating if the operation succeeded. * - * @param array $keysAndValues Array of keys and values to save in cache - * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these - * cache entries (0 => infinite lifeTime). + * @param mixed[] $keysAndValues Array of keys and values to save in cache + * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these + * cache entries (0 => infinite lifeTime). * * @return bool TRUE if the operation was successful, FALSE if it wasn't. */ diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php index c061999..83f2c81 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php @@ -13,6 +13,8 @@ /** * Php file cache driver. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class PhpFileCache extends FileCache { @@ -96,9 +98,9 @@ protected function doSave($id, $data, $lifeTime = 0) } /** - * @return array|null + * @return mixed[]|null */ - private function includeFileForId(string $id) : ?array + private function includeFileForId(string $id): ?array { $fileName = $this->getFilename($id); diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php index 6430d52..7b53b9a 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PredisCache.php @@ -3,15 +3,19 @@ namespace Doctrine\Common\Cache; use Predis\ClientInterface; + use function array_combine; use function array_filter; use function array_map; +use function array_values; use function call_user_func_array; use function serialize; use function unserialize; /** * Predis cache provider. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class PredisCache extends CacheProvider { @@ -41,7 +45,7 @@ protected function doFetch($id) */ protected function doFetchMultiple(array $keys) { - $fetchedItems = call_user_func_array([$this->client, 'mget'], $keys); + $fetchedItems = call_user_func_array([$this->client, 'mget'], array_values($keys)); return array_map('unserialize', array_filter(array_combine($keys, $fetchedItems))); } diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php new file mode 100644 index 0000000..d3693b7 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php @@ -0,0 +1,340 @@ + */ + private $deferredItems = []; + + public static function wrap(Cache $cache): CacheItemPoolInterface + { + if ($cache instanceof DoctrineProvider && ! $cache->getNamespace()) { + return $cache->getPool(); + } + + if ($cache instanceof SymfonyDoctrineProvider && ! $cache->getNamespace()) { + $getPool = function () { + // phpcs:ignore Squiz.Scope.StaticThisUsage.Found + return $this->pool; + }; + + return $getPool->bindTo($cache, SymfonyDoctrineProvider::class)(); + } + + return new self($cache); + } + + private function __construct(Cache $cache) + { + $this->cache = $cache; + } + + /** @internal */ + public function getCache(): Cache + { + return $this->cache; + } + + /** + * {@inheritDoc} + */ + public function getItem($key): CacheItemInterface + { + assert(self::validKey($key)); + + if (isset($this->deferredItems[$key])) { + $this->commit(); + } + + $value = $this->cache->fetch($key); + + if (PHP_VERSION_ID >= 80000) { + if ($value !== false) { + return new TypedCacheItem($key, $value, true); + } + + return new TypedCacheItem($key, null, false); + } + + if ($value !== false) { + return new CacheItem($key, $value, true); + } + + return new CacheItem($key, null, false); + } + + /** + * {@inheritDoc} + */ + public function getItems(array $keys = []): array + { + if ($this->deferredItems) { + $this->commit(); + } + + assert(self::validKeys($keys)); + + $values = $this->doFetchMultiple($keys); + $items = []; + + if (PHP_VERSION_ID >= 80000) { + foreach ($keys as $key) { + if (array_key_exists($key, $values)) { + $items[$key] = new TypedCacheItem($key, $values[$key], true); + } else { + $items[$key] = new TypedCacheItem($key, null, false); + } + } + + return $items; + } + + foreach ($keys as $key) { + if (array_key_exists($key, $values)) { + $items[$key] = new CacheItem($key, $values[$key], true); + } else { + $items[$key] = new CacheItem($key, null, false); + } + } + + return $items; + } + + /** + * {@inheritDoc} + */ + public function hasItem($key): bool + { + assert(self::validKey($key)); + + if (isset($this->deferredItems[$key])) { + $this->commit(); + } + + return $this->cache->contains($key); + } + + public function clear(): bool + { + $this->deferredItems = []; + + if (! $this->cache instanceof ClearableCache) { + return false; + } + + return $this->cache->deleteAll(); + } + + /** + * {@inheritDoc} + */ + public function deleteItem($key): bool + { + assert(self::validKey($key)); + unset($this->deferredItems[$key]); + + return $this->cache->delete($key); + } + + /** + * {@inheritDoc} + */ + public function deleteItems(array $keys): bool + { + foreach ($keys as $key) { + assert(self::validKey($key)); + unset($this->deferredItems[$key]); + } + + return $this->doDeleteMultiple($keys); + } + + public function save(CacheItemInterface $item): bool + { + return $this->saveDeferred($item) && $this->commit(); + } + + public function saveDeferred(CacheItemInterface $item): bool + { + if (! $item instanceof CacheItem && ! $item instanceof TypedCacheItem) { + return false; + } + + $this->deferredItems[$item->getKey()] = $item; + + return true; + } + + public function commit(): bool + { + if (! $this->deferredItems) { + return true; + } + + $now = microtime(true); + $itemsCount = 0; + $byLifetime = []; + $expiredKeys = []; + + foreach ($this->deferredItems as $key => $item) { + $lifetime = ($item->getExpiry() ?? $now) - $now; + + if ($lifetime < 0) { + $expiredKeys[] = $key; + + continue; + } + + ++$itemsCount; + $byLifetime[(int) $lifetime][$key] = $item->get(); + } + + $this->deferredItems = []; + + switch (count($expiredKeys)) { + case 0: + break; + case 1: + $this->cache->delete(current($expiredKeys)); + break; + default: + $this->doDeleteMultiple($expiredKeys); + break; + } + + if ($itemsCount === 1) { + return $this->cache->save($key, $item->get(), (int) $lifetime); + } + + $success = true; + foreach ($byLifetime as $lifetime => $values) { + $success = $this->doSaveMultiple($values, $lifetime) && $success; + } + + return $success; + } + + public function __destruct() + { + $this->commit(); + } + + /** + * @param mixed $key + */ + private static function validKey($key): bool + { + if (! is_string($key)) { + throw new InvalidArgument(sprintf('Cache key must be string, "%s" given.', is_object($key) ? get_class($key) : gettype($key))); + } + + if ($key === '') { + throw new InvalidArgument('Cache key length must be greater than zero.'); + } + + if (strpbrk($key, self::RESERVED_CHARACTERS) !== false) { + throw new InvalidArgument(sprintf('Cache key "%s" contains reserved characters "%s".', $key, self::RESERVED_CHARACTERS)); + } + + return true; + } + + /** + * @param mixed[] $keys + */ + private static function validKeys(array $keys): bool + { + foreach ($keys as $key) { + self::validKey($key); + } + + return true; + } + + /** + * @param mixed[] $keys + */ + private function doDeleteMultiple(array $keys): bool + { + if ($this->cache instanceof MultiDeleteCache) { + return $this->cache->deleteMultiple($keys); + } + + $success = true; + foreach ($keys as $key) { + $success = $this->cache->delete($key) && $success; + } + + return $success; + } + + /** + * @param mixed[] $keys + * + * @return mixed[] + */ + private function doFetchMultiple(array $keys): array + { + if ($this->cache instanceof MultiGetCache) { + return $this->cache->fetchMultiple($keys); + } + + $values = []; + foreach ($keys as $key) { + $value = $this->cache->fetch($key); + if (! $value) { + continue; + } + + $values[$key] = $value; + } + + return $values; + } + + /** + * @param mixed[] $keysAndValues + */ + private function doSaveMultiple(array $keysAndValues, int $lifetime = 0): bool + { + if ($this->cache instanceof MultiPutCache) { + return $this->cache->saveMultiple($keysAndValues, $lifetime); + } + + $success = true; + foreach ($keysAndValues as $key => $value) { + $success = $this->cache->save($key, $value, $lifetime) && $success; + } + + return $success; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php new file mode 100644 index 0000000..0b6f0a2 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php @@ -0,0 +1,118 @@ +key = $key; + $this->value = $data; + $this->isHit = $isHit; + } + + public function getKey(): string + { + return $this->key; + } + + /** + * {@inheritDoc} + * + * @return mixed + */ + public function get() + { + return $this->value; + } + + public function isHit(): bool + { + return $this->isHit; + } + + /** + * {@inheritDoc} + */ + public function set($value): self + { + $this->value = $value; + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAt($expiration): self + { + if ($expiration === null) { + $this->expiry = null; + } elseif ($expiration instanceof DateTimeInterface) { + $this->expiry = (float) $expiration->format('U.u'); + } else { + throw new TypeError(sprintf( + 'Expected $expiration to be an instance of DateTimeInterface or null, got %s', + is_object($expiration) ? get_class($expiration) : gettype($expiration) + )); + } + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAfter($time): self + { + if ($time === null) { + $this->expiry = null; + } elseif ($time instanceof DateInterval) { + $this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); + } elseif (is_int($time)) { + $this->expiry = $time + microtime(true); + } else { + throw new TypeError(sprintf( + 'Expected $time to be either an integer, an instance of DateInterval or null, got %s', + is_object($time) ? get_class($time) : gettype($time) + )); + } + + return $this; + } + + /** + * @internal + */ + public function getExpiry(): ?float + { + return $this->expiry; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php new file mode 100644 index 0000000..3b0f416 --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Doctrine\Common\Cache\Psr6; + +use Doctrine\Common\Cache\Cache; +use Doctrine\Common\Cache\CacheProvider; +use Psr\Cache\CacheItemPoolInterface; +use Symfony\Component\Cache\Adapter\DoctrineAdapter as SymfonyDoctrineAdapter; +use Symfony\Contracts\Service\ResetInterface; + +use function rawurlencode; + +/** + * This class was copied from the Symfony Framework, see the original copyright + * notice above. The code is distributed subject to the license terms in + * https://github.com/symfony/symfony/blob/ff0cf61278982539c49e467db9ab13cbd342f76d/LICENSE + */ +final class DoctrineProvider extends CacheProvider +{ + /** @var CacheItemPoolInterface */ + private $pool; + + public static function wrap(CacheItemPoolInterface $pool): Cache + { + if ($pool instanceof CacheAdapter) { + return $pool->getCache(); + } + + if ($pool instanceof SymfonyDoctrineAdapter) { + $getCache = function () { + // phpcs:ignore Squiz.Scope.StaticThisUsage.Found + return $this->provider; + }; + + return $getCache->bindTo($pool, SymfonyDoctrineAdapter::class)(); + } + + return new self($pool); + } + + private function __construct(CacheItemPoolInterface $pool) + { + $this->pool = $pool; + } + + /** @internal */ + public function getPool(): CacheItemPoolInterface + { + return $this->pool; + } + + public function reset(): void + { + if ($this->pool instanceof ResetInterface) { + $this->pool->reset(); + } + + $this->setNamespace($this->getNamespace()); + } + + /** + * {@inheritdoc} + */ + protected function doFetch($id) + { + $item = $this->pool->getItem(rawurlencode($id)); + + return $item->isHit() ? $item->get() : false; + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doContains($id) + { + return $this->pool->hasItem(rawurlencode($id)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doSave($id, $data, $lifeTime = 0) + { + $item = $this->pool->getItem(rawurlencode($id)); + + if (0 < $lifeTime) { + $item->expiresAfter($lifeTime); + } + + return $this->pool->save($item->set($data)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doDelete($id) + { + return $this->pool->deleteItem(rawurlencode($id)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doFlush() + { + return $this->pool->clear(); + } + + /** + * {@inheritdoc} + * + * @return array|null + */ + protected function doGetStats() + { + return null; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php new file mode 100644 index 0000000..196f1bc --- /dev/null +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php @@ -0,0 +1,13 @@ +key; + } + + public function get(): mixed + { + return $this->value; + } + + public function isHit(): bool + { + return $this->isHit; + } + + public function set(mixed $value): static + { + $this->value = $value; + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAt($expiration): static + { + if ($expiration === null) { + $this->expiry = null; + } elseif ($expiration instanceof DateTimeInterface) { + $this->expiry = (float) $expiration->format('U.u'); + } else { + throw new TypeError(sprintf( + 'Expected $expiration to be an instance of DateTimeInterface or null, got %s', + get_debug_type($expiration) + )); + } + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAfter($time): static + { + if ($time === null) { + $this->expiry = null; + } elseif ($time instanceof DateInterval) { + $this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); + } elseif (is_int($time)) { + $this->expiry = $time + microtime(true); + } else { + throw new TypeError(sprintf( + 'Expected $time to be either an integer, an instance of DateInterval or null, got %s', + get_debug_type($time) + )); + } + + return $this; + } + + /** + * @internal + */ + public function getExpiry(): ?float + { + return $this->expiry; + } +} diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php index 3245705..57d5cd4 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/RedisCache.php @@ -3,6 +3,7 @@ namespace Doctrine\Common\Cache; use Redis; + use function array_combine; use function array_diff_key; use function array_fill_keys; @@ -16,6 +17,8 @@ /** * Redis cache provider. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class RedisCache extends CacheProvider @@ -60,7 +63,7 @@ protected function doFetchMultiple(array $keys) $fetchedItems = array_combine($keys, $this->redis->mget($keys)); // Redis mget returns false for keys that do not exist. So we need to filter those out unless it's the real data. - $keysToFilter = array_keys(array_filter($fetchedItems, static function ($item) : bool { + $keysToFilter = array_keys(array_filter($fetchedItems, static function ($item): bool { return $item === false; })); @@ -69,6 +72,7 @@ protected function doFetchMultiple(array $keys) foreach ($keysToFilter as $key) { $multi->exists($key); } + $existItems = array_filter($multi->exec()); $missedItemKeys = array_diff_key($keysToFilter, $existItems); $fetchedItems = array_diff_key($fetchedItems, array_fill_keys($missedItemKeys, true)); @@ -88,6 +92,7 @@ protected function doSaveMultiple(array $keysAndValues, $lifetime = 0) foreach ($keysAndValues as $key => $value) { $multi->setex($key, $lifetime, $value); } + $succeeded = array_filter($multi->exec()); return count($succeeded) == count($keysAndValues); diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php index 56deb07..a7ad1d4 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/SQLite3Cache.php @@ -4,9 +4,7 @@ use SQLite3; use SQLite3Result; -use const SQLITE3_ASSOC; -use const SQLITE3_BLOB; -use const SQLITE3_TEXT; + use function array_search; use function implode; use function serialize; @@ -14,8 +12,14 @@ use function time; use function unserialize; +use const SQLITE3_ASSOC; +use const SQLITE3_BLOB; +use const SQLITE3_TEXT; + /** * SQLite3 cache provider. + * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 */ class SQLite3Cache extends CacheProvider { @@ -55,7 +59,7 @@ public function __construct(SQLite3 $sqlite, $table) $this->ensureTableExists(); } - private function ensureTableExists() : void + private function ensureTableExists(): void { $this->sqlite->exec( sprintf( @@ -147,9 +151,9 @@ protected function doGetStats() * * @param mixed $id * - * @return array|null + * @return mixed[]|null */ - private function findById($id, bool $includeData = true) : ?array + private function findById($id, bool $includeData = true): ?array { [$idField] = $fields = $this->getFields(); @@ -185,9 +189,9 @@ private function findById($id, bool $includeData = true) : ?array /** * Gets an array of the fields in our table. * - * @return array + * @psalm-return array{string, string, string} */ - private function getFields() : array + private function getFields(): array { return [static::ID_FIELD, static::DATA_FIELD, static::EXPIRATION_FIELD]; } @@ -195,9 +199,9 @@ private function getFields() : array /** * Check if the item is expired. * - * @param array $item + * @param mixed[] $item */ - private function isExpired(array $item) : bool + private function isExpired(array $item): bool { return isset($item[static::EXPIRATION_FIELD]) && $item[self::EXPIRATION_FIELD] !== null && diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php index 834b5b7..6395acb 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Version.php @@ -2,6 +2,9 @@ namespace Doctrine\Common\Cache; +/** + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + */ class Version { public const VERSION = '1.9.0-DEV'; diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php index b58f613..c06c134 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/VoidCache.php @@ -5,6 +5,8 @@ /** * Void cache driver. The cache could be of use in tests where you don`t need to cache anything. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class VoidCache extends CacheProvider diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php index 972f92f..5c8d626 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/WinCacheCache.php @@ -15,6 +15,8 @@ /** * WinCache cache provider. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class WinCacheCache extends CacheProvider diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php index 9b3a485..c532dfc 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/XcacheCache.php @@ -3,7 +3,7 @@ namespace Doctrine\Common\Cache; use BadMethodCallException; -use const XC_TYPE_VAR; + use function ini_get; use function serialize; use function unserialize; @@ -14,6 +14,8 @@ use function xcache_set; use function xcache_unset; +use const XC_TYPE_VAR; + /** * Xcache cache driver. * diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php index a6b67ef..012762a 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ZendDataCache.php @@ -10,6 +10,8 @@ /** * Zend Data Cache cache driver. * + * @deprecated Deprecated without replacement in doctrine/cache 1.11. This class will be dropped in 2.0 + * * @link www.doctrine-project.org */ class ZendDataCache extends CacheProvider diff --git a/vendor/spatie/calendar-links/.github/FUNDING.yml b/vendor/spatie/calendar-links/.github/FUNDING.yml deleted file mode 100644 index 1e0c4e2..0000000 --- a/vendor/spatie/calendar-links/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: https://spatie.be/open-source/support-us \ No newline at end of file diff --git a/vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/01-bug_report.md b/vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/01-bug_report.md deleted file mode 100644 index 5ac5ea1..0000000 --- a/vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/01-bug_report.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Bug report -about: "Something not working as expected? 🐞" -title: '' -labels: "bug" -assignees: '' - ---- - - - -## Context - -1. PHP Version: -1. Package version: - -## Describe the Bug - - - -## Expected Behavior - - diff --git a/vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/02-feature_request.md b/vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/02-feature_request.md deleted file mode 100644 index 55d450a..0000000 --- a/vendor/spatie/calendar-links/.github/ISSUE_TEMPLATE/02-feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Do you want something completely new? ⭐️ -title: '' -labels: "feature request" -assignees: '' - ---- - -## What do you want to achieve? - - diff --git a/vendor/spatie/calendar-links/.github/PULL_REQUEST_TEMPLATE.md b/vendor/spatie/calendar-links/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index bda07b8..0000000 --- a/vendor/spatie/calendar-links/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,9 +0,0 @@ -## Context and Purposes - - diff --git a/vendor/spatie/calendar-links/.github/dependabot.yml b/vendor/spatie/calendar-links/.github/dependabot.yml deleted file mode 100644 index a5538c7..0000000 --- a/vendor/spatie/calendar-links/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: - - package-ecosystem: composer - directory: "/" - schedule: - interval: monthly - open-pull-requests-limit: 10 diff --git a/vendor/spatie/calendar-links/.github/workflows/backward-compatibility-check.yml b/vendor/spatie/calendar-links/.github/workflows/backward-compatibility-check.yml deleted file mode 100644 index a116981..0000000 --- a/vendor/spatie/calendar-links/.github/workflows/backward-compatibility-check.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: [push] -name: Test -jobs: - roave_bc_check: - name: Roave BC Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: fetch tags - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Roave BC Check - uses: docker://nyholm/roave-bc-check-ga \ No newline at end of file diff --git a/vendor/spatie/calendar-links/.github/workflows/ci.yml b/vendor/spatie/calendar-links/.github/workflows/ci.yml deleted file mode 100644 index 54995f8..0000000 --- a/vendor/spatie/calendar-links/.github/workflows/ci.yml +++ /dev/null @@ -1,38 +0,0 @@ -# https://help.github.com/en/categories/automating-your-workflow-with-github-actions - -name: CI - -on: - - pull_request - - push - -jobs: - tests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - php: [7.2, 7.3, 7.4, 8.0] - dependency-version: [prefer-lowest, prefer-stable] - - name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, json, libxml, mbstring, pcre, reflection, spl, xml, xmlwriter - coverage: none - ini-values: assert.exception=1, zend.assertions=1 - - - name: Install dependencies - run: | - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - - - name: Execute tests - run: composer test diff --git a/vendor/spatie/calendar-links/.github/workflows/php-cs-fixer.yml b/vendor/spatie/calendar-links/.github/workflows/php-cs-fixer.yml deleted file mode 100644 index ceb0729..0000000 --- a/vendor/spatie/calendar-links/.github/workflows/php-cs-fixer.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Check & fix styling - -on: - push: - paths: - - '**.php' - - '.composer.lock' - - '.php_cs' - - '.github/workflows/php-cs-fixer.yml' - -jobs: - style: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Fix style - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --config=.php_cs --allow-risky=yes - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Fix styling \ No newline at end of file diff --git a/vendor/spatie/calendar-links/.github/workflows/psalm.yml b/vendor/spatie/calendar-links/.github/workflows/psalm.yml deleted file mode 100644 index 2e76beb..0000000 --- a/vendor/spatie/calendar-links/.github/workflows/psalm.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Psalm - -on: - push: - paths: - - '**.php' - - 'psalm.xml' - -jobs: - psalm: - name: psalm - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick - coverage: none - - - name: Cache composer dependencies - uses: actions/cache@v1 - with: - path: vendor - key: composer-${{ hashFiles('composer.lock') }} - - - name: Run composer install - run: composer install -n --prefer-dist - - - name: Run psalm - run: composer psalm \ No newline at end of file diff --git a/vendor/spatie/calendar-links/.php_cs b/vendor/spatie/calendar-links/.php-cs-fixer.php similarity index 67% rename from vendor/spatie/calendar-links/.php_cs rename to vendor/spatie/calendar-links/.php-cs-fixer.php index 7e4a611..5b9766d 100644 --- a/vendor/spatie/calendar-links/.php_cs +++ b/vendor/spatie/calendar-links/.php-cs-fixer.php @@ -1,6 +1,6 @@ -in([ __DIR__ . '/src', __DIR__ . '/tests', @@ -10,14 +10,14 @@ ->ignoreDotFiles(true) ->ignoreVCS(true); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRules([ '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, @@ -26,9 +26,15 @@ ], 'phpdoc_single_line_var_spacing' => true, 'phpdoc_var_without_name' => true, + 'class_attributes_separation' => [ + 'elements' => [ + 'method' => 'one', + ], + ], 'method_argument_space' => [ 'on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => true, - ] + ], + 'single_trait_insert_per_statement' => true, ]) ->setFinder($finder); diff --git a/vendor/spatie/calendar-links/CHANGELOG.md b/vendor/spatie/calendar-links/CHANGELOG.md index 3cc06cd..176a9ca 100644 --- a/vendor/spatie/calendar-links/CHANGELOG.md +++ b/vendor/spatie/calendar-links/CHANGELOG.md @@ -2,11 +2,57 @@ All notable changes to `calendar-links` will be documented in this file -## Unreleased +## 1.8.2 - 2022-12-11 +### Changed + - ICS: Use `DESCRIPTION` instead of `X-ALT-DESC` (as it has better support) by @cdubz in #158 + - Chore: fix tests, fix and improve CI + +## 1.8.1 - 2022-12-01 +### Changed + - Remove PHP 7.4 support + - Update dependencies + +## 1.8.0 - 2022-08-20 +### Changed + - ICS: Add `PRODID` and `DTSTAMP` required parameters to make ICS valid by @makbeta + - ICS: Fix HTML description for Outlook 2016 by @karthikbodu + - Outlook: extract common logic for `WebOffice` and `WebOutlook` into a parent class by @lptn + +### Fixed +- Simplify format of test snapshots: do not use base64 by @lptn +- Fix typo in README by @fabpot + +## 1.7.2 - 2022-06-09 +### Fixed + - Outlook: Fixed #148 Support HTML-formatted description by @dravenk in #150 + +## 1.7.1 - 2022-02-14 +### Changed + - Outlook: Fixed location field characters (by @dravenk in #144) + - Add missing dependency of php-cs-fixer and update it + +## 1.7.0 - 2022-02-13 +### Changed + - New: Add support for outlook.office.com $link->webOffice(); (@dravenk and @gulios) + - Google: Add timezone name if it is specified in both `from` and `to` dates and is the same for both (@bradyemerson) + +## 1.6.0 - 2021-04-22 +### Changed +- Drop support for PHP 7.2 and PHP 7.3 + +## 1.5.0 - 2021-04-22 +### Changed + - ICS: support URLs as option (@gulios) + - ICS: support all day events spanning multiple days (@mrshowerman) + +## 1.4.4 - 2021-04-13 +### Fixed + - Yahoo link doesn’t work (yahoo changed param names) (@mukeshsah08). + - Exception message on invalid dates range (idea by @jason-nabooki) ## 1.4.3 - 2021-03-05 ### Changed - - Google: use UTC timezone to bypass problems with some timzone names unsupported by Google calendar (⚠️ backwards-incompatible if you extended Google Generator) + - Google: use UTC timezone to bypass problems with some timezone names unsupported by Google calendar (⚠️ backwards-incompatible if you extended Google Generator) ### Fixed - Spaces replaced by "+" on Outlook.com #109 @@ -19,7 +65,7 @@ All notable changes to `calendar-links` will be documented in this file ### Changed - Simplify extending of WebOutlook (e.g. for Office365) - Yahoo: use `allday` parameter only for a single-day events - - Improve exception hierarchy: `InvalidLink` now extends `\InvalidArgumentException` + - Improve exception hierarchy: `InvalidLink` now extends `\InvalidArgumentException` ### Added - Add more tests, reorganize existing @@ -76,5 +122,4 @@ All notable changes to `calendar-links` will be documented in this file - Use `\n` instead of `%0A` when generating an ics file ## 1.0.0 - 2017-09-29 - - initial release diff --git a/vendor/spatie/calendar-links/CONTRIBUTING.md b/vendor/spatie/calendar-links/CONTRIBUTING.md deleted file mode 100644 index 4da74e3..0000000 --- a/vendor/spatie/calendar-links/CONTRIBUTING.md +++ /dev/null @@ -1,55 +0,0 @@ -# Contributing - -Contributions are **welcome** and will be fully **credited**. - -Please read and understand the contribution guide before creating an issue or pull request. - -## Etiquette - -This project is open source, and as such, the maintainers give their free time to build and maintain the source code -held within. They make the code freely available in the hope that it will be of use to other developers. It would be -extremely unfair for them to suffer abuse or anger for their hard work. - -Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the -world that developers are civilized and selfless people. - -It's the duty of the maintainer to ensure that all submissions to the project are of sufficient -quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used. - -## Viability - -When requesting or submitting new features, first consider whether it might be useful to others. Open -source projects are used by many developers, who may have entirely different needs to your own. Think about -whether or not your feature is likely to be used by other users of the project. - -## Procedure - -Before filing an issue: - -- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident. -- Check to make sure your feature suggestion isn't already present within the project. -- Check the pull requests tab to ensure that the bug doesn't have a fix in progress. -- Check the pull requests tab to ensure that the feature isn't already in progress. - -Before submitting a pull request: - -- Check the codebase to ensure that your feature doesn't already exist. -- Check the pull requests to ensure that another person hasn't already submitted the feature or fix. - -## Requirements - -If the project maintainer has any additional requirements, you will find them listed here. - -- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). - -- **Add tests!** - Your patch won't be accepted if it doesn't have tests. - -- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. - -- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. - -- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. - -- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. - -**Happy coding**! diff --git a/vendor/spatie/calendar-links/README.md b/vendor/spatie/calendar-links/README.md index 835621a..37067c7 100644 --- a/vendor/spatie/calendar-links/README.md +++ b/vendor/spatie/calendar-links/README.md @@ -1,9 +1,14 @@ + +[](https://supportukrainenow.org) + # Generate add to calendar links for Google, iCal and other calendar systems [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/calendar-links.svg?style=flat-square)](https://packagist.org/packages/spatie/calendar-links) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/calendar-links.svg?style=flat-square)](https://packagist.org/packages/spatie/calendar-links) -![Test](https://github.com/spatie/calendar-links/workflows/Test/badge.svg) +[![Test](https://github.com/spatie/calendar-links/workflows/Test/badge.svg)](https://github.com/spatie/calendar-links/actions/workflows/run-tests.yml) [![Quality Score](https://img.shields.io/scrutinizer/g/spatie/calendar-links.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/calendar-links) +[![Type coverage](https://shepherd.dev/github/spatie/calendar-links/coverage.svg)](https://shepherd.dev/github/spatie/calendar-links) +[![Psalm level](https://shepherd.dev/github/spatie/calendar-links/level.svg)](https://shepherd.dev/github/spatie/calendar-links) Using this package you can generate links to add events to calendar systems. Here's a quick example: @@ -36,20 +41,20 @@ We highly appreciate you sending us a postcard from your hometown, mentioning wh You can install the package via composer: -```bash +```sh composer require spatie/calendar-links ``` ## Usage -``` php +```php description('Cookies & cocktails!') ->address('Kruikstraat 22, 2018 Antwerpen'); @@ -59,35 +64,44 @@ echo $link->google(); // Generate a link to create an event on Yahoo calendar echo $link->yahoo(); -// Generate a link to create an event on outlook.com calendar +// Generate a link to create an event on outlook.live.com calendar echo $link->webOutlook(); +// Generate a link to create an event on outlook.office.com calendar +echo $link->webOffice(); + // Generate a data uri for an ics file (for iCal & Outlook) echo $link->ics(); -// Generate a data uri using arbitrary generator: +// Generate a data URI using arbitrary generator: echo $link->formatWith(new \Your\Generator()); ``` > ⚠️ ICS download links don't work in IE and EdgeHTML-based Edge browsers, see [details](https://github.com/spatie/calendar-links/issues/71). +## Package principles + +1. it should produce a small output (to keep pagesize small) +2. it should be fast (no any external heavy dependencies) +3. all features should be supported by at least 2 generators (different services have different features) + ## Changelog Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing -``` bash +```sh composer test ``` ## Contributing -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. +Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details. ## Security -If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker. +If you've found a bug regarding security please mail [security@spatie.be](mailto:security@spatie.be) instead of using the issue tracker. ## Postcardware diff --git a/vendor/spatie/calendar-links/composer.json b/vendor/spatie/calendar-links/composer.json index 2cd45a0..c7390c5 100644 --- a/vendor/spatie/calendar-links/composer.json +++ b/vendor/spatie/calendar-links/composer.json @@ -16,12 +16,13 @@ } ], "require": { - "php": "^7.2 || ^8.0" + "php": "^8.0" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.0", - "spatie/phpunit-snapshot-assertions": "^3.0|^4.0", - "vimeo/psalm": "^4.1" + "friendsofphp/php-cs-fixer": "^3.14", + "phpunit/phpunit": "^9.6 || ^10.0", + "spatie/phpunit-snapshot-assertions": "^4.2 || ^5.0", + "vimeo/psalm": "^5.6" }, "autoload": { "psr-4": { @@ -35,7 +36,8 @@ }, "scripts": { "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes", - "psalm": "vendor/bin/psalm", + "psalm": "vendor/bin/psalm --find-unused-psalm-suppress --output-format=phpstorm", + "psalm:ci": "vendor/bin/psalm --find-unused-psalm-suppress --output-format=github --shepherd", "test": "vendor/bin/phpunit", "test:update-snapshots": "vendor/bin/phpunit -d --update-snapshots" }, diff --git a/vendor/spatie/calendar-links/psalm-baseline.xml b/vendor/spatie/calendar-links/psalm-baseline.xml new file mode 100644 index 0000000..793cfb5 --- /dev/null +++ b/vendor/spatie/calendar-links/psalm-baseline.xml @@ -0,0 +1,36 @@ + + + + + setTimezone + setTimezone + + + + + setTimezone + setTimezone + + + + + setTimezone + setTimezone + + + + + $property + + + modify + + + clone $from + clone $to + + + new static($title, $from, $to, $allDay) + + + diff --git a/vendor/spatie/calendar-links/psalm.xml b/vendor/spatie/calendar-links/psalm.xml index 956335a..cb3e980 100644 --- a/vendor/spatie/calendar-links/psalm.xml +++ b/vendor/spatie/calendar-links/psalm.xml @@ -1,17 +1,22 @@ + + + + - \ No newline at end of file + diff --git a/vendor/spatie/calendar-links/src/Exceptions/InvalidLink.php b/vendor/spatie/calendar-links/src/Exceptions/InvalidLink.php index 1b64574..5eac383 100644 --- a/vendor/spatie/calendar-links/src/Exceptions/InvalidLink.php +++ b/vendor/spatie/calendar-links/src/Exceptions/InvalidLink.php @@ -9,7 +9,15 @@ class InvalidLink extends InvalidArgumentException { private const DATETIME_FORMAT = 'Y-m-d H:i:s'; + /** @deprecated Will be removed in 2.0, please use {@see InvalidLink::negativeDateRange} instead */ public static function invalidDateRange(DateTimeInterface $to, DateTimeInterface $from): self + { + trigger_error(sprintf('Method %s::%s is deprecated, please use %s::negativeDateRange method instead', self::class, __METHOD__, self::class), \E_USER_DEPRECATED); + + return new self("TO time (`{$to->format(self::DATETIME_FORMAT)}`) must be greater than FROM time (`{$from->format(self::DATETIME_FORMAT)}`)"); + } + + public static function negativeDateRange(DateTimeInterface $from, DateTimeInterface $to): self { return new self("TO time (`{$to->format(self::DATETIME_FORMAT)}`) must be greater than FROM time (`{$from->format(self::DATETIME_FORMAT)}`)"); } diff --git a/vendor/spatie/calendar-links/src/Generators/BaseOutlook.php b/vendor/spatie/calendar-links/src/Generators/BaseOutlook.php new file mode 100644 index 0000000..15d0434 --- /dev/null +++ b/vendor/spatie/calendar-links/src/Generators/BaseOutlook.php @@ -0,0 +1,56 @@ +baseUrl(); + + $dateTimeFormat = $link->allDay ? $this->dateFormat : $this->dateTimeFormat; + + $utcStartDateTime = (clone $link->from)->setTimezone(new DateTimeZone('UTC')); + $utcEndDateTime = (clone $link->to)->setTimezone(new DateTimeZone('UTC')); + + $url .= '&startdt='.$utcStartDateTime->format($dateTimeFormat); + $url .= '&enddt='.$utcEndDateTime->format($dateTimeFormat); + + if ($link->allDay) { + $url .= '&allday=true'; + } + + $url .= '&subject='.$this->sanitizeString($link->title); + + if ($link->description) { + $url .= '&body='.$this->sanitizeString($link->description); + } + + if ($link->address) { + $url .= '&location='.$this->sanitizeString($link->address); + } + + return $url; + } + + private function sanitizeString(string $input): string + { + return rawurlencode($input); + } +} diff --git a/vendor/spatie/calendar-links/src/Generators/Google.php b/vendor/spatie/calendar-links/src/Generators/Google.php index 306c88d..5ff4fe6 100644 --- a/vendor/spatie/calendar-links/src/Generators/Google.php +++ b/vendor/spatie/calendar-links/src/Generators/Google.php @@ -13,6 +13,7 @@ class Google implements Generator { /** @var string {@see https://www.php.net/manual/en/function.date.php} */ protected $dateFormat = 'Ymd'; + /** @var string */ protected $dateTimeFormat = 'Ymd\THis\Z'; /** {@inheritDoc} */ @@ -25,6 +26,14 @@ public function generate(Link $link): string $dateTimeFormat = $link->allDay ? $this->dateFormat : $this->dateTimeFormat; $url .= '&dates='.$utcStartDateTime->format($dateTimeFormat).'/'.$utcEndDateTime->format($dateTimeFormat); + // Add timezone name if it is specified in both from and to dates and is the same for both + if ( + $link->from->getTimezone() && $link->to->getTimezone() + && $link->from->getTimezone()->getName() === $link->to->getTimezone()->getName() + ) { + $url .= '&ctz=' . $link->from->getTimezone()->getName(); + } + $url .= '&text='.urlencode($link->title); if ($link->description) { diff --git a/vendor/spatie/calendar-links/src/Generators/Ics.php b/vendor/spatie/calendar-links/src/Generators/Ics.php index fc1713a..b738974 100644 --- a/vendor/spatie/calendar-links/src/Generators/Ics.php +++ b/vendor/spatie/calendar-links/src/Generators/Ics.php @@ -12,11 +12,15 @@ class Ics implements Generator { /** @var string {@see https://www.php.net/manual/en/function.date.php} */ protected $dateFormat = 'Ymd'; - protected $dateTimeFormat = 'e:Ymd\THis'; + /** @var string */ + protected $dateTimeFormat = 'Ymd\THis\Z'; - /** @var array */ + /** @var array */ protected $options = []; + /** + * @param array $options + */ public function __construct(array $options = []) { $this->options = $options; @@ -27,7 +31,8 @@ public function generate(Link $link): string { $url = [ 'BEGIN:VCALENDAR', - 'VERSION:2.0', + 'VERSION:2.0', // @see https://datatracker.ietf.org/doc/html/rfc5545#section-3.7.4 + 'PRODID:Spatie calendar-links', // @see https://datatracker.ietf.org/doc/html/rfc5545#section-3.7.3 'BEGIN:VEVENT', 'UID:'.($this->options['UID'] ?? $this->generateEventUid($link)), 'SUMMARY:'.$this->escapeString($link->title), @@ -36,20 +41,26 @@ public function generate(Link $link): string $dateTimeFormat = $link->allDay ? $this->dateFormat : $this->dateTimeFormat; if ($link->allDay) { - $url[] = 'DTSTART:'.$link->from->format($dateTimeFormat); - $url[] = 'DURATION:P1D'; + $url[] = 'DTSTAMP:'.gmdate($dateTimeFormat, $link->from->getTimestamp()); + $url[] = 'DTSTART:'.gmdate($dateTimeFormat, $link->from->getTimestamp()); + $url[] = 'DURATION:P'.(max(1, $link->from->diff($link->to)->days)).'D'; } else { - $url[] = 'DTSTART;TZID='.$link->from->format($dateTimeFormat); - $url[] = 'DTEND;TZID='.$link->to->format($dateTimeFormat); + $url[] = 'DTSTAMP:'.gmdate($dateTimeFormat, $link->from->getTimestamp()); + $url[] = 'DTSTART:'.gmdate($dateTimeFormat, $link->from->getTimestamp()); + $url[] = 'DTEND:'.gmdate($dateTimeFormat, $link->to->getTimestamp()); } if ($link->description) { - $url[] = 'DESCRIPTION:'.$this->escapeString($link->description); + $url[] = 'DESCRIPTION:'.$this->escapeString(strip_tags($link->description)); } if ($link->address) { $url[] = 'LOCATION:'.$this->escapeString($link->address); } + if (isset($this->options['URL'])) { + $url[] = 'URL;VALUE=URI:'.$this->options['URL']; + } + $url[] = 'END:VEVENT'; $url[] = 'END:VCALENDAR'; diff --git a/vendor/spatie/calendar-links/src/Generators/WebOffice.php b/vendor/spatie/calendar-links/src/Generators/WebOffice.php new file mode 100644 index 0000000..b52a7f6 --- /dev/null +++ b/vendor/spatie/calendar-links/src/Generators/WebOffice.php @@ -0,0 +1,14 @@ +allDay ? $this->dateFormat : $this->dateTimeFormat; - - $utcStartDateTime = (clone $link->from)->setTimezone(new DateTimeZone('UTC')); - $utcEndDateTime = (clone $link->to)->setTimezone(new DateTimeZone('UTC')); - - $url .= '&startdt='.$utcStartDateTime->format($dateTimeFormat); - $url .= '&enddt='.$utcEndDateTime->format($dateTimeFormat); - - if ($link->allDay) { - $url .= '&allday=true'; - } - - $url .= '&subject='.urlencode($this->sanitizeText($link->title)); - - if ($link->description) { - $url .= '&body='.urlencode($this->sanitizeText($link->description)); - } - - if ($link->address) { - $url .= '&location='.urlencode($this->sanitizeText($link->address)); - } - - return $url; - } - - /** - * Generate an text without html entity code and hexadecimal code instead spaces. - * @param string $text - * @return string - */ - private function sanitizeText(string $text): string + /** @inheritDoc */ + public function baseUrl(): string { - $replaceList = [ - '/\s/' => ' ', - ]; - - $resultText = html_entity_decode($text); - - foreach ($replaceList as $pattern => $newValue) { - $resultText = preg_replace($pattern, $newValue, $resultText); - } - - return $resultText; + return static::BASE_URL; } } diff --git a/vendor/spatie/calendar-links/src/Generators/Yahoo.php b/vendor/spatie/calendar-links/src/Generators/Yahoo.php index f4764ec..c6a18db 100644 --- a/vendor/spatie/calendar-links/src/Generators/Yahoo.php +++ b/vendor/spatie/calendar-links/src/Generators/Yahoo.php @@ -13,6 +13,7 @@ class Yahoo implements Generator { /** @var string {@see https://www.php.net/manual/en/function.date.php} */ protected $dateFormat = 'Ymd'; + /** @var string */ protected $dateTimeFormat = 'Ymd\THis\Z'; /** {@inheritDoc} */ @@ -22,41 +23,37 @@ public function generate(Link $link): string $dateTimeFormat = $link->allDay ? $this->dateFormat : $this->dateTimeFormat; - if ($link->allDay && $link->from->diff($link->to)->days === 1) { - $url .= '&st='.$link->from->format($dateTimeFormat); - $url .= '&dur=allday'; + if ($link->allDay) { + $url .= '&ST='.$link->from->format($dateTimeFormat); + $url .= '&DUR=allday'; + $url .= '&ET='.$link->to->format($dateTimeFormat); } else { $utcStartDateTime = (clone $link->from)->setTimezone(new DateTimeZone('UTC')); $utcEndDateTime = (clone $link->to)->setTimezone(new DateTimeZone('UTC')); - - $url .= '&st='.$utcStartDateTime->format($dateTimeFormat); - - /** - * Yahoo has a bug on parsing end date parameter: it ignores timezone, assuming - * that it's specified in user's tz. In order to bypass it, we can use duration ("dur") - * parameter instead of "et", but this parameter has a limitation cause by it's format HHmm: - * the max duration is 99hours and 59 minutes (dur=9959). - */ - $maxDurationInSecs = (59 * 60 * 60) + (59 * 60); - $canUseDuration = $maxDurationInSecs > ($utcEndDateTime->getTimestamp() - $utcStartDateTime->getTimestamp()); - if ($canUseDuration) { - $dateDiff = $utcStartDateTime->diff($utcEndDateTime); - $url .= '&dur='.$dateDiff->format('%H%I'); - } else { - $url .= '&et='.$utcEndDateTime->format($dateTimeFormat); - } + $url .= '&ST='.$utcStartDateTime->format($dateTimeFormat); + $url .= '&ET='.$utcEndDateTime->format($dateTimeFormat); } - $url .= '&title='.urlencode($link->title); + $url .= '&TITLE='.$this->sanitizeText($link->title); if ($link->description) { - $url .= '&desc='.urlencode($link->description); + $url .= '&DESC='.$this->sanitizeText($link->description); } if ($link->address) { - $url .= '&in_loc='.urlencode($link->address); + $url .= '&in_loc='.$this->sanitizeText($link->address); } return $url; } + + /** + * Prepare text to use used in URL and parsed by the service. + * @param string $text + * @return string + */ + private function sanitizeText(string $text): string + { + return rawurlencode($text); + } } diff --git a/vendor/spatie/calendar-links/src/Link.php b/vendor/spatie/calendar-links/src/Link.php index c083556..56ab3c3 100644 --- a/vendor/spatie/calendar-links/src/Link.php +++ b/vendor/spatie/calendar-links/src/Link.php @@ -2,17 +2,17 @@ namespace Spatie\CalendarLinks; -use DateTimeInterface; use Spatie\CalendarLinks\Exceptions\InvalidLink; use Spatie\CalendarLinks\Generators\Google; use Spatie\CalendarLinks\Generators\Ics; +use Spatie\CalendarLinks\Generators\WebOffice; use Spatie\CalendarLinks\Generators\WebOutlook; use Spatie\CalendarLinks\Generators\Yahoo; /** * @property-read string $title - * @property-read DateTimeInterface|\DateTime|\DateTimeImmutable $from - * @property-read DateTimeInterface|\DateTime|\DateTimeImmutable $to + * @property-read \DateTimeInterface|\DateTime|\DateTimeImmutable $from + * @property-read \DateTimeInterface|\DateTime|\DateTimeImmutable $to * @property-read string $description * @property-read string $address * @property-read bool $allDay @@ -37,13 +37,13 @@ class Link /** @var string */ protected $address; - public function __construct(string $title, DateTimeInterface $from, DateTimeInterface $to, bool $allDay = false) + public function __construct(string $title, \DateTimeInterface $from, \DateTimeInterface $to, bool $allDay = false) { $this->title = $title; $this->allDay = $allDay; - if ($to < $from) { - throw InvalidLink::invalidDateRange($from, $to); + if ($from > $to) { + throw InvalidLink::negativeDateRange($from, $to); } $this->from = clone $from; @@ -59,20 +59,20 @@ public function __construct(string $title, DateTimeInterface $from, DateTimeInte * @return static * @throws InvalidLink */ - public static function create(string $title, DateTimeInterface $from, DateTimeInterface $to, bool $allDay = false) + public static function create(string $title, \DateTimeInterface $from, \DateTimeInterface $to, bool $allDay = false) { return new static($title, $from, $to, $allDay); } /** * @param string $title - * @param DateTimeInterface|\DateTime|\DateTimeImmutable $fromDate + * @param \DateTimeInterface|\DateTime|\DateTimeImmutable $fromDate * @param int $numberOfDays * * @return Link * @throws InvalidLink */ - public static function createAllDay(string $title, DateTimeInterface $fromDate, int $numberOfDays = 1): self + public static function createAllDay(string $title, \DateTimeInterface $fromDate, int $numberOfDays = 1): self { $from = (clone $fromDate)->modify('midnight'); $to = (clone $from)->modify("+$numberOfDays days"); @@ -114,6 +114,10 @@ public function google(): string return $this->formatWith(new Google()); } + /** + * @param array $options + * @return string + */ public function ics(array $options = []): string { return $this->formatWith(new Ics($options)); @@ -129,6 +133,11 @@ public function webOutlook(): string return $this->formatWith(new WebOutlook()); } + public function webOffice(): string + { + return $this->formatWith(new WebOffice()); + } + public function __get($property) { return $this->$property; From 752ef3a9a5a35b022ca50f29dc3e1ac2dad7308e Mon Sep 17 00:00:00 2001 From: Thomas Skerbis Date: Mon, 30 Oct 2023 16:28:24 +0100 Subject: [PATCH 2/2] Update package.yml --- package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.yml b/package.yml index aa3b36a..aa9a9d9 100755 --- a/package.yml +++ b/package.yml @@ -1,5 +1,5 @@ package: forcal -version: '3.7.4' +version: '3.8.0' name: forcal author: Friends Of REDAXO supportpage: https://github.com/FriendsOfREDAXO/forcal