diff --git a/composer.json b/composer.json index aec54d422..155466ac2 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,8 @@ "lint:changed": "vendor/bin/phpcs-changed origin/main", "fix": "vendor/bin/phpcbf", "fix:changed": "vendor/bin/phpcbf-changed origin/main", - "post-update-cmd": [] + "post-update-cmd": [], + "unused": "vendor/bin/class-leak check library" }, "config": { "allow-plugins": { @@ -69,7 +70,8 @@ "10up/wp_mock": "dev-trunk#1.0.1", "php-mock/php-mock-mockery": "^1.4", "php-stubs/wordpress-stubs": "^6.7", - "dg/bypass-finals": "^1.9" + "dg/bypass-finals": "^1.9", + "tomasvotruba/class-leak": "^2.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 0216aa4a1..3f1782bf9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb45936c0940246ca8edafae23549f81", + "content-hash": "e30ceb8e4ed8ccc97b69efba00cc5998", "packages": [ { "name": "composer/installers", @@ -642,16 +642,16 @@ }, { "name": "spatie/schema-org", - "version": "3.23.0", + "version": "3.23.1", "source": { "type": "git", "url": "https://github.com/spatie/schema-org.git", - "reference": "c95abf7da59f16570aec18ca11d861255e645c39" + "reference": "a8dc1b6fcdd06afc1ab084c3ead9b7a4c3d7a35d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/schema-org/zipball/c95abf7da59f16570aec18ca11d861255e645c39", - "reference": "c95abf7da59f16570aec18ca11d861255e645c39", + "url": "https://api.github.com/repos/spatie/schema-org/zipball/a8dc1b6fcdd06afc1ab084c3ead9b7a4c3d7a35d", + "reference": "a8dc1b6fcdd06afc1ab084c3ead9b7a4c3d7a35d", "shasum": "" }, "require": { @@ -660,7 +660,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.6", - "graham-campbell/analyzer": "^3.0.5", + "graham-campbell/analyzer": "^4.2", "illuminate/collections": "^8.62.0", "league/flysystem": "^2.3.0 || ^3.0", "pestphp/pest": "^1.21", @@ -699,7 +699,7 @@ ], "support": { "issues": "https://github.com/spatie/schema-org/issues", - "source": "https://github.com/spatie/schema-org/tree/3.23.0" + "source": "https://github.com/spatie/schema-org/tree/3.23.1" }, "funding": [ { @@ -711,7 +711,7 @@ "type": "github" } ], - "time": "2024-01-11T14:58:44+00:00" + "time": "2025-01-31T14:54:12+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -871,16 +871,16 @@ }, { "name": "symfony/var-dumper", - "version": "v7.2.0", + "version": "v7.2.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c6a22929407dec8765d6e2b6ff85b800b245879c" + "reference": "82b478c69745d8878eb60f9a049a4d584996f73a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c6a22929407dec8765d6e2b6ff85b800b245879c", - "reference": "c6a22929407dec8765d6e2b6ff85b800b245879c", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/82b478c69745d8878eb60f9a049a4d584996f73a", + "reference": "82b478c69745d8878eb60f9a049a4d584996f73a", "shasum": "" }, "require": { @@ -934,7 +934,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.2.0" + "source": "https://github.com/symfony/var-dumper/tree/v7.2.3" }, "funding": [ { @@ -950,7 +950,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T15:48:14+00:00" + "time": "2025-01-17T11:39:41+00:00" } ], "packages-dev": [ @@ -1433,16 +1433,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -1481,7 +1481,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -1489,7 +1489,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", @@ -1669,27 +1669,27 @@ }, { "name": "php-mock/php-mock", - "version": "2.5.1", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock.git", - "reference": "8f58972dce4de5a804dc0459383a11bc651416cf" + "reference": "c7b6789056dfc3c45389cabbe9930dc33aeb2bf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock/zipball/8f58972dce4de5a804dc0459383a11bc651416cf", - "reference": "8f58972dce4de5a804dc0459383a11bc651416cf", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/c7b6789056dfc3c45389cabbe9930dc33aeb2bf0", + "reference": "c7b6789056dfc3c45389cabbe9930dc33aeb2bf0", "shasum": "" }, "require": { "php": "^5.6 || ^7.0 || ^8.0", - "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4" + "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4 || ^5" }, "replace": { "malkusch/php-mock": "*" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0 || ^11.0", + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0", "squizlabs/php_codesniffer": "^3.8" }, "suggest": { @@ -1733,7 +1733,7 @@ ], "support": { "issues": "https://github.com/php-mock/php-mock/issues", - "source": "https://github.com/php-mock/php-mock/tree/2.5.1" + "source": "https://github.com/php-mock/php-mock/tree/2.6.1" }, "funding": [ { @@ -1741,29 +1741,29 @@ "type": "github" } ], - "time": "2024-12-07T20:52:37+00:00" + "time": "2025-02-28T18:11:56+00:00" }, { "name": "php-mock/php-mock-integration", - "version": "2.3.0", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-integration.git", - "reference": "ec6a00a8129d50ed0f07907c91e3274ca4ade877" + "reference": "0ea2fb4b69598eed8a300271f8e8117b143c7b2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/ec6a00a8129d50ed0f07907c91e3274ca4ade877", - "reference": "ec6a00a8129d50ed0f07907c91e3274ca4ade877", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/0ea2fb4b69598eed8a300271f8e8117b143c7b2c", + "reference": "0ea2fb4b69598eed8a300271f8e8117b143c7b2c", "shasum": "" }, "require": { "php": ">=5.6", "php-mock/php-mock": "^2.5", - "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4" + "phpunit/php-text-template": "^1 || ^2 || ^3 || ^4 || ^5" }, "require-dev": { - "phpunit/phpunit": "^5.7.27 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11" + "phpunit/phpunit": "^5.7.27 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12" }, "type": "library", "autoload": { @@ -1796,7 +1796,7 @@ ], "support": { "issues": "https://github.com/php-mock/php-mock-integration/issues", - "source": "https://github.com/php-mock/php-mock-integration/tree/2.3.0" + "source": "https://github.com/php-mock/php-mock-integration/tree/2.4.0" }, "funding": [ { @@ -1804,7 +1804,7 @@ "type": "github" } ], - "time": "2024-02-10T21:37:25+00:00" + "time": "2025-02-24T14:51:05+00:00" }, { "name": "php-mock/php-mock-mockery", @@ -3604,6 +3604,54 @@ ], "time": "2024-03-03T12:36:25+00:00" }, + { + "name": "tomasvotruba/class-leak", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/TomasVotruba/class-leak.git", + "reference": "4fcf2aa7c7b819bd2007b4540fe2deb89ae070a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/TomasVotruba/class-leak/zipball/4fcf2aa7c7b819bd2007b4540fe2deb89ae070a0", + "reference": "4fcf2aa7c7b819bd2007b4540fe2deb89ae070a0", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "bin": [ + "bin/class-leak", + "bin/class-leak.php" + ], + "type": "library", + "autoload": { + "psr-4": { + "TomasVotruba\\ClassLeak\\": "app" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Detect leaking classes", + "support": { + "issues": "https://github.com/TomasVotruba/class-leak/issues", + "source": "https://github.com/TomasVotruba/class-leak/tree/2.0.3" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2025-01-14T14:54:23+00:00" + }, { "name": "wp-coding-standards/wpcs", "version": "3.1.0", diff --git a/library/App.php b/library/App.php index 8c3435a20..02a0aa21e 100644 --- a/library/App.php +++ b/library/App.php @@ -996,7 +996,7 @@ private function setupExternalContent(): void * Trigger sync of external content. */ $triggerSync = new \Municipio\ExternalContent\SyncHandler\Triggers\TriggerSync($this->wpService); - //$triggerSync = new \Municipio\ExternalContent\SyncHandler\Triggers\TriggerSyncIfNotInProgress(new \Municipio\ExternalContent\SyncHandler\SyncInProgress\PostTypeSyncInProgress($this->wpService), $triggerSync); + $triggerSync = new \Municipio\ExternalContent\SyncHandler\Triggers\TriggerSyncIfNotInProgress(new \Municipio\ExternalContent\SyncHandler\SyncInProgress\PostTypeSyncInProgress($this->wpService), $triggerSync); (new \Municipio\ExternalContent\SyncHandler\Triggers\TriggerSyncFromGetParams($this->wpService, $triggerSync))->addHooks(); /** diff --git a/library/ExternalContent/AcfFieldContentModifiers/PopulateTaxonomySchemaPropertyFieldOptions.php b/library/ExternalContent/AcfFieldContentModifiers/PopulateTaxonomySchemaPropertyFieldOptions.php deleted file mode 100644 index 570c2659e..000000000 --- a/library/ExternalContent/AcfFieldContentModifiers/PopulateTaxonomySchemaPropertyFieldOptions.php +++ /dev/null @@ -1,38 +0,0 @@ -getEnabledSchemaTypes->getEnabledSchemaTypesAndProperties(); - $enabledProperties = array_map(function ($item) { - if (!empty($item)) { - $subItemsWithNamedKeys = []; - foreach ($item as $subItem) { - $subItemsWithNamedKeys[$subItem] = $subItem; - } - return $subItemsWithNamedKeys; - } - - return $item; - }, $enabledProperties); - - $field['choices'] = array_filter($enabledProperties, fn($item) => !empty($item)); - - return $field; - } - - public function getFieldKey(): string - { - return $this->fieldKey; - } -} diff --git a/library/ExternalContent/SyncHandler/SyncHandlerInterface.php b/library/ExternalContent/SyncHandler/SyncHandlerInterface.php deleted file mode 100644 index 3e0aaa59e..000000000 --- a/library/ExternalContent/SyncHandler/SyncHandlerInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -