Fix nullability of return types that can be non-null (#15927)

* Fix nullability of Children extension

* Fix nullability of methods throughout the CMS

* Fix return types of some methods that cannot return null

* Revert nullable changes to result of ConvertSourceToIntermediate for property editors (whilst some property editors we know won't return null, it seems more consistent to adhere to the base class and interface nullability definition).

* Updated new webhook events to align with new nullability definitions.

* Reverted content editing service updates to align with base classes.

* Applied collection nullability updates on content repository to interface.

* Reverted value converter updates to match interface.

* Applied further collection updates to interface.

* Aligned media service interface with implementation for nullability.

* Update from code review.

---------

Co-authored-by: Ivo van der Bruggen <ivo@dutchbreeze.com>
Co-authored-by: Ivo van der Bruggen <ivo@vdbruggensoftware.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
This commit is contained in:
Ivo van der Bruggen
2025-07-30 14:19:20 +02:00
committed by GitHub
parent c6bc4ef49a
commit c3e93f143c
154 changed files with 172 additions and 172 deletions

View File

@@ -110,7 +110,7 @@ public static class FriendlyPublishedContentExtensions
/// The specific culture to get the name for. If null is used the current culture is used (Default is
/// null).
/// </param>
public static string? Name(
public static string Name(
this IPublishedContent content,
string? culture = null)
=> content.Name(VariationContextAccessor, culture);
@@ -505,7 +505,7 @@ public static class FriendlyPublishedContentExtensions
/// <remarks>
/// <para>Children are sorted by their sortOrder.</para>
/// </remarks>
public static IEnumerable<IPublishedContent>? Children(
public static IEnumerable<IPublishedContent> Children(
this IPublishedContent content,
Func<IPublishedContent, bool> predicate,
string? culture = null)
@@ -521,7 +521,7 @@ public static class FriendlyPublishedContentExtensions
/// </param>
/// <param name="contentTypeAlias">The content type alias.</param>
/// <returns>The children of the content, of any of the specified types.</returns>
public static IEnumerable<IPublishedContent>? ChildrenOfType(this IPublishedContent content, string contentTypeAlias, string? culture = null)
public static IEnumerable<IPublishedContent> ChildrenOfType(this IPublishedContent content, string contentTypeAlias, string? culture = null)
=> content.ChildrenOfType(GetNavigationQueryService(content), GetPublishedStatusFilteringService(content), contentTypeAlias, culture);
/// <summary>
@@ -537,7 +537,7 @@ public static class FriendlyPublishedContentExtensions
/// <remarks>
/// <para>Children are sorted by their sortOrder.</para>
/// </remarks>
public static IEnumerable<T>? Children<T>(this IPublishedContent content, string? culture = null)
public static IEnumerable<T> Children<T>(this IPublishedContent content, string? culture = null)
where T : class, IPublishedContent
=> content.Children<T>(GetNavigationQueryService(content), GetPublishedStatusFilteringService(content), culture);
@@ -576,7 +576,7 @@ public static class FriendlyPublishedContentExtensions
/// <remarks>
/// <para>Note that in V7 this method also return the content node self.</para>
/// </remarks>
public static IEnumerable<IPublishedContent>? Siblings(this IPublishedContent content, string? culture = null)
public static IEnumerable<IPublishedContent> Siblings(this IPublishedContent content, string? culture = null)
=> content.Siblings(GetNavigationQueryService(content), GetPublishedStatusFilteringService(content), culture);
/// <summary>
@@ -592,7 +592,7 @@ public static class FriendlyPublishedContentExtensions
/// <remarks>
/// <para>Note that in V7 this method also return the content node self.</para>
/// </remarks>
public static IEnumerable<IPublishedContent>? SiblingsOfType(this IPublishedContent content, string contentTypeAlias, string? culture = null)
public static IEnumerable<IPublishedContent> SiblingsOfType(this IPublishedContent content, string contentTypeAlias, string? culture = null)
=> content.SiblingsOfType(GetNavigationQueryService(content), GetPublishedStatusFilteringService(content), contentTypeAlias, culture);
/// <summary>
@@ -608,7 +608,7 @@ public static class FriendlyPublishedContentExtensions
/// <remarks>
/// <para>Note that in V7 this method also return the content node self.</para>
/// </remarks>
public static IEnumerable<T>? Siblings<T>(this IPublishedContent content, string? culture = null)
public static IEnumerable<T> Siblings<T>(this IPublishedContent content, string? culture = null)
where T : class, IPublishedContent
=> content.Siblings<T>(GetNavigationQueryService(content), GetPublishedStatusFilteringService(content), culture);
@@ -636,7 +636,7 @@ public static class FriendlyPublishedContentExtensions
/// </param>
/// <param name="contentTypeAlias">The content type alias.</param>
/// <returns>The siblings of the content including the node itself, of the given content type.</returns>
public static IEnumerable<IPublishedContent>? SiblingsAndSelfOfType(
public static IEnumerable<IPublishedContent> SiblingsAndSelfOfType(
this IPublishedContent content,
string contentTypeAlias,
string? culture = null)
@@ -652,7 +652,7 @@ public static class FriendlyPublishedContentExtensions
/// null)
/// </param>
/// <returns>The siblings of the content including the node itself, of the given content type.</returns>
public static IEnumerable<T>? SiblingsAndSelf<T>(this IPublishedContent content, string? culture = null)
public static IEnumerable<T> SiblingsAndSelf<T>(this IPublishedContent content, string? culture = null)
where T : class, IPublishedContent
=> content.SiblingsAndSelf<T>(GetNavigationQueryService(content), GetPublishedStatusFilteringService(content), culture);