Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolved deprecations in ibexa/system-info package #55

Merged
merged 5 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bundle/Resources/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ services:
arguments:
$composerCollector: '@Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector'
$kernelProjectDir: '%kernel.project_dir%'
$debug: '%kernel.debug%'
tags:
- { name: ibexa.system_info.collector, identifier: ibexa }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
label: 'ibexa.stability'|trans|desc('Stability'),
content: info.stability,
content: info.lowestStability,
},
] %}

Expand Down
36 changes: 2 additions & 34 deletions src/bundle/SystemInfo/Collector/IbexaSystemInfoCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@ class IbexaSystemInfoCollector implements SystemInfoCollector
*/
public const PACKAGE_WATCH_REGEX = '/^(doctrine|ezsystems|silversolutions|symfony)\//';

/**
* Packages that identify installation as "Content".
*
* @deprecated Since 4.6. Use self::HEADLESS_PACKAGES const instead.
*/
public const CONTENT_PACKAGES = [
'ibexa/content',
];

/**
* Packages that identify installation as "Headless".
*/
Expand All @@ -114,18 +105,6 @@ class IbexaSystemInfoCollector implements SystemInfoCollector
'ibexa/experience',
];

/**
* Packages that identify installation as "Enterprise".
*
* @deprecated since Ibexa DXP 3.3. Rely either on <code>IbexaSystemInfoCollector::EXPERIENCE_PACKAGES</code>
* or <code>IbexaSystemInfoCollector::CONTENT_PACKAGES</code>.
*/
public const ENTERPRISE_PACKAGES = [
'ibexa/page-builder',
'ezsystems/flex-workflow',
'ezsystems/landing-page-fieldtype-bundle',
];

/**
* Packages that identify installation as "Commerce".
*/
Expand All @@ -138,29 +117,22 @@ class IbexaSystemInfoCollector implements SystemInfoCollector
*/
private $composerInfo;

/**
* @var bool
*/
private $debug;

/** @var string */
private $kernelProjectDir;

/**
* @param \Ibexa\Bundle\SystemInfo\SystemInfo\Collector\JsonComposerLockSystemInfoCollector|\Ibexa\Bundle\SystemInfo\SystemInfo\Collector\SystemInfoCollector $composerCollector
* @param bool $debug
*/
public function __construct(
SystemInfoCollector $composerCollector,
string $kernelProjectDir,
bool $debug = false
) {
try {
$this->composerInfo = $composerCollector->collect();
} catch (ComposerLockFileNotFoundException | ComposerFileValidationException $e) {
// do nothing
}
$this->debug = $debug;

$this->kernelProjectDir = $kernelProjectDir;
}

Expand All @@ -176,7 +148,6 @@ public function collect(): IbexaSystemInfo
$vendorDir = sprintf('%s/vendor/', $this->kernelProjectDir);

$ibexa = new IbexaSystemInfo([
'debug' => $this->debug,
'name' => IbexaSystemInfoExtension::getNameByPackages($vendorDir),
]);

Expand Down Expand Up @@ -214,16 +185,13 @@ private function extractComposerInfo(IbexaSystemInfo $ibexa): void
return;
}

// BC (deprecated property)
$ibexa->composerInfo = ['minimumStability' => $this->composerInfo->minimumStability];

$dxpPackages = array_merge(
self::HEADLESS_PACKAGES,
self::EXPERIENCE_PACKAGES,
self::COMMERCE_PACKAGES
);
$ibexa->isEnterprise = self::hasAnyPackage($this->composerInfo, $dxpPackages);
$ibexa->stability = $ibexa->lowestStability = self::getStability($this->composerInfo);
$ibexa->lowestStability = self::getStability($this->composerInfo);
}

/**
Expand Down
26 changes: 1 addition & 25 deletions src/bundle/SystemInfo/Value/IbexaSystemInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ class IbexaSystemInfo extends ValueObject implements SystemInfo
'oss' => self::PRODUCT_NAME_OSS,
'headless' => 'Ibexa Headless',
'experience' => 'Ibexa Experience',
'commerce' => self::PRODUCT_NAME_COMMERCE,
'commerce' => 'Ibexa Commerce',
];

// @deprecated: use PRODUCT_NAME_VARIANTS
public const PRODUCT_NAME_COMMERCE = 'Ibexa Commerce';

/**
* @var string
*/
Expand Down Expand Up @@ -87,25 +84,4 @@ class IbexaSystemInfo extends ValueObject implements SystemInfo
* @var string One of {@see \Ibexa\SystemInfo\Value\Stability::STABILITIES}.
*/
public $lowestStability;

/**
* @deprecated Instead use $lowestStability.
*
* @var string One of {@see \Ibexa\SystemInfo\Value\Stability::STABILITIES}.
*/
public $stability;

/**
* @deprecated Duplicates collected info on symfony
*
* @var bool
*/
public $debug;

/**
* @deprecated This was duplication of collected info from Composer, now only contains key 'minimumStability'
*
* @var array|null
*/
public $composerInfo;
}
Loading