Skip to content
Snippets Groups Projects
Verified Commit fd2c1341 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3048495 by jonathan1055, quietone, rajandro, Spokje, Pooja Ganjage,...

Issue #3048495 by jonathan1055, quietone, rajandro, Spokje, Pooja Ganjage, andypost, kishor_kolekar, msuthars, munish.kumar, ankithashetty, ayushmishra206, ravi.shankar, naveenvalecha, longwave, Gábor Hojtsy, alexpott, smustgrave, Lendude, xjm, adityasingh, daffie: Fix Drupal.Semantics.FunctionTriggerError coding standard
parent dff46835
Branches
Tags
42 merge requests!12227Issue #3181946 by jonmcl, mglaman,!54479.5.x SF update,!5014Issue #3071143: Table Render Array Example Is Incorrect,!3878Removed unused condition head title for views,!38582585169-10.1.x,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3668Resolve #3347842 "Deprecate the trusted",!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3546refactored dialog.pcss file,!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3502Issue #3335308: Confusing behavior with FormState::setFormState and FormState::setMethod,!3478Issue #3337882: Deleted menus are not removed from content type config,!3452Issue #3332701: Refactor Claro's tablesort-indicator stylesheet,!3451Issue #2410579: Allows setting the current language programmatically.,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3147Issue #3328457: Replace most substr($a, $i) where $i is negative with str_ends_with(),!3146Issue #3328456: Replace substr($a, 0, $i) with str_starts_with(),!3133core/modules/system/css/components/hidden.module.css,!31312878513-10.1.x,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2614Issue #2981326: Replace non-test usages of \Drupal::logger() with IoC injection,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1591Issue #3199697: Add JSON:API Translation experimental module,!1255Issue #3238922: Refactor (if feasible) uses of the jQuery serialize function to use vanillaJS,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!844Resolve #3036010 "Updaters",!673Issue #3214208: FinishResponseSubscriber could create duplicate headers,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493,!485Sets the autocomplete attribute for username/password input field on login form.,!213Issue #2906496: Give Media a menu item under Content
Pipeline #23863 failed
Showing
with 20 additions and 12 deletions
......@@ -2,7 +2,7 @@
namespace Drupal\Component\Assertion;
trigger_error(__NAMESPACE__ . '\Handle is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, use assert_options(ASSERT_EXCEPTION, TRUE). See https://drupal.org/node/3105918', E_USER_DEPRECATED);
trigger_error(__NAMESPACE__ . '\Handle is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, use assert_options(ASSERT_EXCEPTION, TRUE). See https://www.drupal.org/node/3105918', E_USER_DEPRECATED);
/**
* Handler for runtime assertion failures.
......
......@@ -2,7 +2,7 @@
namespace Drupal\Component\Plugin;
@trigger_error('The ' . __NAMESPACE__ . '\PluginHelper is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, use instanceof() to check for \Drupal\Component\Plugin\ConfigurableInterface. See http://drupal.org/node/3198285', E_USER_DEPRECATED);
@trigger_error('The ' . __NAMESPACE__ . '\PluginHelper is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, use instanceof() to check for \Drupal\Component\Plugin\ConfigurableInterface. See https://www.drupal.org/node/3198285', E_USER_DEPRECATED);
/**
* A helper class to determine if a plugin is configurable.
......
......@@ -201,6 +201,7 @@ protected static function placeholderFormat($string, array $args) {
// and in D11 this will no longer be allowed. When this trigger_error
// is removed, also remove isset $value checks inside the switch{}
// below.
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error(sprintf('Deprecated NULL placeholder value for key (%s) in: "%s". This will throw a PHP error in drupal:11.0.0. See https://www.drupal.org/node/3318826', (string) $key, (string) $string), E_USER_DEPRECATED);
$value = '';
}
......
......@@ -100,7 +100,7 @@ public function __construct(AssetResolverInterface $asset_resolver, ConfigFactor
$this->renderer = $renderer;
$this->moduleHandler = $module_handler;
if (!isset($languageManager)) {
@trigger_error('Calling ' . __METHOD__ . '() without the $language_manager argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0', E_USER_DEPRECATED);
@trigger_error('Calling ' . __METHOD__ . '() without the $language_manager argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3347754', E_USER_DEPRECATED);
$this->languageManager = \Drupal::languageManager();
}
}
......
......@@ -131,7 +131,7 @@ public function optimize(array $css_assets, array $libraries) {
* {@inheritdoc}
*/
public function getAll() {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and will be removed in drupal:11.0.0, there is no replacement. See https:// www.drupal.org/node/3301744', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3301744', E_USER_DEPRECATED);
return [];
}
......
......@@ -146,7 +146,7 @@ public function optimize(array $js_assets, array $libraries) {
* {@inheritdoc}
*/
public function getAll() {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and will be removed in drupal:11.0.0, there is no replacement. See https:// www.drupal.org/node/3301744', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3301744', E_USER_DEPRECATED);
return [];
}
......
......@@ -60,6 +60,7 @@ public function getLibraryByName($extension, $name) {
return FALSE;
}
if (isset($libraries[$name]['deprecated'])) {
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error(str_replace('%library_id%', "$extension/$name", $libraries[$name]['deprecated']), E_USER_DEPRECATED);
}
return $libraries[$name];
......
......@@ -139,6 +139,7 @@ protected function applyLibrariesExtend($extension, $library_name, $library_defi
if (isset($library_definition['deprecated'])) {
$extend_message = sprintf('Theme "%s" is extending a deprecated library.', $extension);
$library_deprecation = str_replace('%library_id%', "$extension/$library_name", $library_definition['deprecated']);
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error("$extend_message $library_deprecation", E_USER_DEPRECATED);
}
if (!is_string($library_extend_name)) {
......
......@@ -404,6 +404,7 @@ protected function applyLibrariesOverride($libraries, $extension) {
if (isset($library['deprecated'])) {
$override_message = sprintf('Theme "%s" is overriding a deprecated library.', $extension);
$library_deprecation = str_replace('%library_id%', "$extension/$library_name", $library['deprecated']);
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error("$override_message $library_deprecation", E_USER_DEPRECATED);
}
// Active theme defines an override for this library.
......
......@@ -148,7 +148,7 @@ public static function getBins() {
* A hash of the query arguments.
*/
public static function keyFromQuery(SelectInterface $query) {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. No replacement provided. https://www.drupal.org/node/3322044', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. No replacement provided. See https://www.drupal.org/node/3322044', E_USER_DEPRECATED);
$query->preExecute();
$keys = [(string) $query, $query->getArguments()];
return hash('sha256', serialize($keys));
......
......@@ -101,7 +101,7 @@ public function checkConfigSchema(TypedConfigManagerInterface $typed_config, $co
// failing the test (which would be too disruptive for the ecosystem), but
// trigger a deprecation notice instead.
if (!empty($validation_errors) && $this->isContribViolation()) {
@trigger_error(sprintf("The '%s' configuration contains validation errors. Invalid config is deprecated in drupal:10.2.0 and will be required to be valid in drupal:11.0.0. The following validation errors were found:\n\t\t- %s",
@trigger_error(sprintf("The '%s' configuration contains validation errors. Invalid config is deprecated in drupal:10.2.0 and will be required to be valid in drupal:11.0.0. The following validation errors were found:\n\t\t- %s\nSee https://www.drupal.org/node/3362879",
$config_name,
implode("\n\t\t- ", $validation_errors)
), E_USER_DEPRECATED);
......
......@@ -39,7 +39,7 @@ public function __construct(HttpMessageFactoryInterface $http_message_factory) {
* @see https://www.drupal.org/node/3383585
*/
public function supports(Request $request, ArgumentMetadata $argument): bool {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and will be removed in drupal:11.0.0, there is no replacement. See https://www.drupal.org/node/3383585', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3383585', E_USER_DEPRECATED);
return $argument->getType() == ServerRequestInterface::class;
}
......
......@@ -22,7 +22,7 @@ final class RouteMatchValueResolver implements ValueResolverInterface {
* @see https://www.drupal.org/node/3383585
*/
public function supports(Request $request, ArgumentMetadata $argument): bool {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and will be removed in drupal:11.0.0, there is no replacement. See https://www.drupal.org/node/3383585', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3383585', E_USER_DEPRECATED);
return $argument->getType() == RouteMatchInterface::class || is_subclass_of($argument->getType(), RouteMatchInterface::class);
}
......
......@@ -20,6 +20,7 @@ public function __get($name) {
if (isset($this->deprecatedProperties[$name])) {
$service_name = $this->deprecatedProperties[$name];
$class_name = static::class;
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error("The property $name ($service_name service) is deprecated in $class_name and will be removed before Drupal 11.0.0.", E_USER_DEPRECATED);
return \Drupal::service($service_name);
}
......
......@@ -191,7 +191,7 @@ public static function trustedCallbacks() {
* @see https://www.drupal.org/node/3314346
*/
public function viewRevision(EntityInterface $_entity_revision, $view_mode = 'full') {
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\Controller\EntityRevisionViewController instead. See https://www.drupal.org/node/3314346.', E_USER_DEPRECATED);
@trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\Controller\EntityRevisionViewController instead. See https://www.drupal.org/node/3314346', E_USER_DEPRECATED);
return $this->view($_entity_revision, $view_mode);
}
......
......@@ -126,6 +126,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
throw new ObsoleteExtensionException("Unable to install modules: module '$module' is obsolete.");
}
if ($module_data[$module]->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER] === ExtensionLifecycle::DEPRECATED) {
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error("The module '$module' is deprecated. See " . $module_data[$module]->info['lifecycle_link'], E_USER_DEPRECATED);
}
}
......
......@@ -159,6 +159,7 @@ public function install(array $theme_list, $install_dependencies = TRUE) {
$unmet_module_dependencies = array_diff_key($module_dependencies, $installed_modules);
if ($theme_data[$theme]->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER] === ExtensionLifecycle::DEPRECATED) {
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error("The theme '$theme' is deprecated. See " . $theme_data[$theme]->info['lifecycle_link'], E_USER_DEPRECATED);
}
......
......@@ -73,7 +73,7 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac
$this->setCacheBackend($cache_backend, 'element_info');
$this->themeManager = $theme_manager;
if ($theme_handler instanceof CacheTagsInvalidatorInterface) {
@trigger_error('Calling ' . __METHOD__ . '() with the $cache_tag_invalidator argument is deprecated and replaced with $theme_handler in drupal:10.2.0 and will be removed in drupal:11.0.0.', E_USER_DEPRECATED);
@trigger_error('Calling ' . __METHOD__ . '() with the $cache_tag_invalidator argument is deprecated in drupal:10.2.0 and will be removed in drupal:11.0.0. Pass $theme_handler instead. See https://www.drupal.org/node/3355227', E_USER_DEPRECATED);
$theme_handler = \Drupal::service('theme_handler');
}
$this->themeHandler = $theme_handler;
......
......@@ -109,6 +109,7 @@ public function __construct(AssetResolverInterface $asset_resolver, ConfigFactor
$this->renderer = $renderer;
$this->moduleHandler = $module_handler;
if (!isset($languageManager)) {
// phpcs:ignore Drupal.Semantics.FunctionTriggerError
@trigger_error('Calling ' . __METHOD__ . '() without the $languageManager argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0', E_USER_DEPRECATED);
$this->languageManager = \Drupal::languageManager();
}
......
......@@ -85,7 +85,7 @@ class PlaceholderingRenderCache extends RenderCache {
*/
public function __construct(RequestStack $request_stack, $cache_factory, CacheContextsManager $cache_contexts_manager, PlaceholderGeneratorInterface $placeholder_generator) {
if ($cache_factory instanceof CacheFactoryInterface) {
@trigger_error('Injecting ' . __CLASS__ . ' with the "cache_factory" service is deprecated in drupal:10.2.0, use "variation_cache_factory" instead.', E_USER_DEPRECATED);
@trigger_error('Injecting ' . __CLASS__ . ' with the "cache_factory" service is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use "variation_cache_factory" instead. See https://www.drupal.org/node/3365546', E_USER_DEPRECATED);
$cache_factory = \Drupal::service('variation_cache_factory');
}
parent::__construct($request_stack, $cache_factory, $cache_contexts_manager);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment