private function updatePluginSettings ()
	{
		echo '    > Upgrade Maps settings' . PHP_EOL;

		/** @var Settings $settings */
		$settings = SimpleMap::getInstance()->getSettings()->toArray();
		$newSettings = SimpleMap::getInstance()->getSettings()->toArray();

		$craft2Settings = \Craft::$app->projectConfig->get(
			Plugins::CONFIG_PLUGINS_KEY . '.simple-map.settings'
		);

		if (is_array($craft2Settings) && !empty($craft2Settings))
		{
			$settings = [
				'apiKey' => $craft2Settings['browserApiKey'],
				'unrestrictedApiKey' => $craft2Settings['serverApiKey'],
			];
		}

		if ($settings['unrestrictedApiKey'])
		{
			$newSettings['geoService'] = GeoService::GoogleMaps;
			$newSettings['geoToken'] = $settings['unrestrictedApiKey'];
		}

		if ($settings['apiKey'])
		{
			$newSettings['mapTiles'] = MapTiles::GoogleRoadmap;
			$newSettings['mapToken'] = $settings['apiKey'];

			if (!$settings['unrestrictedApiKey'])
			{
				$newSettings['geoService'] = GeoService::GoogleMaps;
				$newSettings['geoToken'] = $settings['apiKey'];
			}
		}

		\Craft::$app->plugins->savePluginSettings(
			SimpleMap::getInstance(),
			$newSettings
		);

		\Craft::$app->plugins->enablePlugin(SimpleMap::getInstance()->handle);
	}
private function updatePluginSettings ()
	{
		echo '    > Upgrade Maps settings' . PHP_EOL;

		/** @var Settings $settings */
		$settings = SimpleMap::getInstance()->getSettings()->toArray();
		$newSettings = SimpleMap::getInstance()->getSettings()->toArray();

		$craft2Settings = \Craft::$app->projectConfig->get(
			Plugins::CONFIG_PLUGINS_KEY . '.simple-map.settings'
		);

		if (is_array($craft2Settings) && !empty($craft2Settings))
		{
			$settings = [
				'apiKey' => $craft2Settings['browserApiKey'],
				'unrestrictedApiKey' => $craft2Settings['serverApiKey'],
			];
		}

		if ($settings['unrestrictedApiKey'])
		{
			$newSettings['geoService'] = GeoService::GoogleMaps;
			$newSettings['geoToken'] = $settings['unrestrictedApiKey'];
		}

		if ($settings['apiKey'])
		{
			$newSettings['mapTiles'] = MapTiles::GoogleRoadmap;
			$newSettings['mapToken'] = $settings['apiKey'];

			if (!$settings['unrestrictedApiKey'])
			{
				$newSettings['geoService'] = GeoService::GoogleMaps;
				$newSettings['geoToken'] = $settings['apiKey'];
			}
		}

		\Craft::$app->plugins->savePluginSettings(
			SimpleMap::getInstance(),
			$newSettings
		);

		\Craft::$app->plugins->enablePlugin(SimpleMap::getInstance()->handle);
	}
private function updatePluginSettings ( ) { echo '    > Upgrade Maps settings' . PHP_EOL ; /** @var Settings $settings */ $ settings = SimpleMap :: getInstance ( ) -> getSettings ( ) -> toArray ( ) ; $ newSettings = SimpleMap :: getInstance ( ) -> getSettings ( ) -> toArray ( ) ; $ craft2Settings = \ Craft :: $ app -> projectConfig -> get ( Plugins :: CONFIG_PLUGINS_KEY . '.simple-map.settings' ) ; if ( is_array ( $ craft2Settings ) && ! empty ( $ craft2Settings ) ) { $ settings = [ 'apiKey' => $ craft2Settings [ 'browserApiKey' ] , 'unrestrictedApiKey' => $ craft2Settings [ 'serverApiKey' ] , ] ; } if ( $ settings [ 'unrestrictedApiKey' ] ) { $ newSettings [ 'geoService' ] = GeoService :: GoogleMaps ; $ newSettings [ 'geoToken' ] = $ settings [ 'unrestrictedApiKey' ] ; } if ( $ settings [ 'apiKey' ] ) { $ newSettings [ 'mapTiles' ] = MapTiles :: GoogleRoadmap ; $ newSettings [ 'mapToken' ] = $ settings [ 'apiKey' ] ; if ( ! $ settings [ 'unrestrictedApiKey' ] ) { $ newSettings [ 'geoService' ] = GeoService :: GoogleMaps ; $ newSettings [ 'geoToken' ] = $ settings [ 'apiKey' ] ; } } \ Craft :: $ app -> plugins -> savePluginSettings ( SimpleMap :: getInstance ( ) , $ newSettings ) ; \ Craft :: $ app -> plugins -> enablePlugin ( SimpleMap :: getInstance ( ) -> handle ) ; }
Updates the plugins settings
@throws \craft\errors\InvalidPluginException
Updates the plugins settings