From b1ece9b2023a19565e191edcd8e51818cbc15183 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 4 May 2022 19:01:54 +0200 Subject: [PATCH] NRT amends necessary for Deploy (#12357) * Allowed null item retrievel in IDeployContext. * Allowed null item retrievel in IImageSourceParser. * Allowed null item retrievel in IMacroParser. * Set null syntax for other Deploy interfaces. (cherry picked from commit a42ff2c2677aac437bcefb7f8304775b4a32d07b) --- src/Umbraco.Core/Deploy/IDeployContext.cs | 4 ++-- src/Umbraco.Core/Deploy/IImageSourceParser.cs | 6 ++---- src/Umbraco.Core/Deploy/IMacroParser.cs | 6 +++--- src/Umbraco.Core/Deploy/IServiceConnector.cs | 4 ++-- src/Umbraco.Core/Deploy/IValueConnector.cs | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Core/Deploy/IDeployContext.cs b/src/Umbraco.Core/Deploy/IDeployContext.cs index c2a3a39d1e..c6e2da997b 100644 --- a/src/Umbraco.Core/Deploy/IDeployContext.cs +++ b/src/Umbraco.Core/Deploy/IDeployContext.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace Umbraco.Cms.Core.Deploy @@ -37,7 +37,7 @@ namespace Umbraco.Cms.Core.Deploy /// The type of the item. /// The key of the item. /// The item with the specified key and type, if any, else null. - T Item(string key) where T : class; + T? Item(string key) where T : class; ///// ///// Gets the global deployment cancellation token. diff --git a/src/Umbraco.Core/Deploy/IImageSourceParser.cs b/src/Umbraco.Core/Deploy/IImageSourceParser.cs index a15b45f40b..084ba1b118 100644 --- a/src/Umbraco.Core/Deploy/IImageSourceParser.cs +++ b/src/Umbraco.Core/Deploy/IImageSourceParser.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace Umbraco.Cms.Core.Deploy { /// @@ -14,7 +12,7 @@ namespace Umbraco.Cms.Core.Deploy /// A list of dependencies. /// The parsed value. /// Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies. - string ToArtifact(string value, ICollection dependencies); + string? ToArtifact(string? value, ICollection dependencies); /// /// Parses an artifact property value and produces an Umbraco property value. @@ -22,6 +20,6 @@ namespace Umbraco.Cms.Core.Deploy /// The artifact property value. /// The parsed value. /// Turns umb://media/... into /media/.... - string FromArtifact(string value); + string? FromArtifact(string? value); } } diff --git a/src/Umbraco.Core/Deploy/IMacroParser.cs b/src/Umbraco.Core/Deploy/IMacroParser.cs index 622a4abc1b..81b014c1cc 100644 --- a/src/Umbraco.Core/Deploy/IMacroParser.cs +++ b/src/Umbraco.Core/Deploy/IMacroParser.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Umbraco.Cms.Core.Deploy { @@ -10,14 +10,14 @@ namespace Umbraco.Cms.Core.Deploy /// Property value. /// A list of dependencies. /// Parsed value. - string ToArtifact(string value, ICollection dependencies); + string? ToArtifact(string? value, ICollection dependencies); /// /// Parses an artifact property value and produces an Umbraco property value. /// /// Artifact property value. /// Parsed value. - string FromArtifact(string value); + string? FromArtifact(string? value); /// /// Tries to replace the value of the attribute/parameter with a value containing a converted identifier. diff --git a/src/Umbraco.Core/Deploy/IServiceConnector.cs b/src/Umbraco.Core/Deploy/IServiceConnector.cs index b28989f5de..dfc4f3d28e 100644 --- a/src/Umbraco.Core/Deploy/IServiceConnector.cs +++ b/src/Umbraco.Core/Deploy/IServiceConnector.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Cms.Core.Composing; namespace Umbraco.Cms.Core.Deploy @@ -13,7 +13,7 @@ namespace Umbraco.Cms.Core.Deploy /// /// The entity identifier of the artifact. /// The corresponding artifact, or null. - IArtifact GetArtifact(Udi udi); + IArtifact? GetArtifact(Udi udi); /// /// Gets an artifact. diff --git a/src/Umbraco.Core/Deploy/IValueConnector.cs b/src/Umbraco.Core/Deploy/IValueConnector.cs index b7ba2e4096..32a536a870 100644 --- a/src/Umbraco.Core/Deploy/IValueConnector.cs +++ b/src/Umbraco.Core/Deploy/IValueConnector.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Umbraco.Cms.Core.Models; namespace Umbraco.Cms.Core.Deploy @@ -23,7 +23,7 @@ namespace Umbraco.Cms.Core.Deploy /// The value property type /// The content dependencies. /// The deploy property value. - string ToArtifact(object value, IPropertyType propertyType, ICollection dependencies); + string? ToArtifact(object? value, IPropertyType propertyType, ICollection dependencies); /// /// Gets the content property value corresponding to a deploy property value. @@ -32,6 +32,6 @@ namespace Umbraco.Cms.Core.Deploy /// The value property type< /// The current content property value. /// The content property value. - object FromArtifact(string value, IPropertyType propertyType, object currentValue); + object? FromArtifact(string? value, IPropertyType propertyType, object currentValue); } }