From 5e4ad92b130d5616b9c0b105fff7377964920fcb Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 30 May 2023 11:08:18 -0400 Subject: [PATCH] cleanup based on feedback --- src/Flex.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Flex.php b/src/Flex.php index 0be9160d5..e437e8e46 100644 --- a/src/Flex.php +++ b/src/Flex.php @@ -60,7 +60,8 @@ */ class Flex implements PluginInterface, EventSubscriberInterface { - public static $storedOperations = null; + public static $storedOperations = []; + /** * @var Composer */ @@ -129,11 +130,9 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__) // if Flex is being upgraded, the original operations from the original Flex // instance are stored in the static property, so we can reuse them now. - if (property_exists(self::class, 'storedOperations')) { - if (null !== self::$storedOperations) { - $this->operations = self::$storedOperations; - self::$storedOperations = null; - } + if (property_exists(self::class, 'storedOperations') && self::$storedOperations) { + $this->operations = self::$storedOperations; + self::$storedOperations = []; } $symfonyRequire = preg_replace('/\.x$/', '.x-dev', getenv('SYMFONY_REQUIRE') ?: ($composer->getPackage()->getExtra()['symfony']['require'] ?? ''));