class MissingProjectInfo in Automatic Updates 8
Missing project info checker.
Hierarchy
- class \Drupal\automatic_updates\ReadinessChecker\MissingProjectInfo implements ReadinessCheckerInterface uses IgnoredPathsTrait, ProjectInfoTrait, StringTranslationTrait
Expanded class hierarchy of MissingProjectInfo
1 file declares its use of MissingProjectInfo
- MissingProjectInfoTest.php in tests/
src/ Kernel/ ReadinessChecker/ MissingProjectInfoTest.php
1 string reference to 'MissingProjectInfo'
1 service uses MissingProjectInfo
File
- src/
ReadinessChecker/ MissingProjectInfo.php, line 13
Namespace
Drupal\automatic_updates\ReadinessCheckerView source
class MissingProjectInfo implements ReadinessCheckerInterface {
use IgnoredPathsTrait;
use ProjectInfoTrait;
use StringTranslationTrait;
/**
* The module extension list.
*
* @var \Drupal\Core\Extension\ExtensionList
*/
protected $modules;
/**
* The profile extension list.
*
* @var \Drupal\Core\Extension\ExtensionList
*/
protected $profiles;
/**
* The theme extension list.
*
* @var \Drupal\Core\Extension\ExtensionList
*/
protected $themes;
/**
* MissingProjectInfo constructor.
*
* @param \Drupal\Core\Extension\ExtensionList $modules
* The module extension list.
* @param \Drupal\Core\Extension\ExtensionList $profiles
* The profile extension list.
* @param \Drupal\Core\Extension\ExtensionList $themes
* The theme extension list.
*/
public function __construct(ExtensionList $modules, ExtensionList $profiles, ExtensionList $themes) {
$this->modules = $modules;
$this->profiles = $profiles;
$this->themes = $themes;
}
/**
* {@inheritdoc}
*/
public function run() {
return $this
->missingProjectInfoCheck();
}
/**
* Check for projects missing project info.
*
* @return array
* An array of translatable strings if any checks fail.
*/
protected function missingProjectInfoCheck() {
$messages = [];
foreach ($this
->getExtensionsTypes() as $extension_type) {
foreach ($this
->getInfos($extension_type) as $info) {
if ($this
->isIgnoredPath($info['install path'])) {
continue;
}
if (!$info['version']) {
$messages[] = $this
->t('The project "@extension" can not be updated because its version is either undefined or a dev release.', [
'@extension' => $info['name'],
]);
}
}
}
return $messages;
}
/**
* Get the extension types.
*
* @return array
* The extension types.
*/
protected function getExtensionsTypes() {
return [
'modules',
'profiles',
'themes',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IgnoredPathsTrait:: |
protected | function | Gets the config factory. | |
IgnoredPathsTrait:: |
protected | function | Get the path matcher service. | |
IgnoredPathsTrait:: |
protected | function | Check if the file path is ignored. | |
MissingProjectInfo:: |
protected | property | The module extension list. | |
MissingProjectInfo:: |
protected | property | The profile extension list. | |
MissingProjectInfo:: |
protected | property | The theme extension list. | |
MissingProjectInfo:: |
protected | function | Get the extension types. | |
MissingProjectInfo:: |
protected | function | Check for projects missing project info. | |
MissingProjectInfo:: |
public | function |
Run check. Overrides ReadinessCheckerInterface:: |
|
MissingProjectInfo:: |
public | function | MissingProjectInfo constructor. | |
ProjectInfoTrait:: |
protected | function | Get the composer.json as a JSON array. | |
ProjectInfoTrait:: |
protected | function | Get extension list. | |
ProjectInfoTrait:: |
protected | function | Get the extension version. | |
ProjectInfoTrait:: |
protected | function | Returns an array of info files information of available extensions. | 1 |
ProjectInfoTrait:: |
protected | function | Get the extension's project name. | |
ProjectInfoTrait:: |
protected | function | Get string suffix. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |