Skip to content
Snippets Groups Projects
Commit f7a45904 authored by Jonathan Smith's avatar Jonathan Smith
Browse files

Issue #3476450: Fix PHPCS NullabilityTypeMissing

parent f65e27c5
Branches
Tags
1 merge request!177#3476450 Fix NullableTypeForNullDefaultValue.NullabilityTypeMissing
Pipeline #291624 passed
......@@ -117,7 +117,7 @@ class SchedulerRulesEventsTest extends SchedulerBrowserTestBase {
* The ids of the messages that should be showing on the current page. All
* other messages should not be displayed.
*/
public function checkMessages(string $entityTypeId = NULL, array $expectedMessages = []) {
public function checkMessages(?string $entityTypeId = NULL, array $expectedMessages = []) {
// Add the required entity offset to each message id in the expected array.
$offset = ['node' => 0, 'media' => 6, 'commerce_product' => 12, 'taxonomy_term' => 18];
array_walk($expectedMessages, function (&$item) use ($offset, $entityTypeId) {
......
......@@ -962,7 +962,7 @@ class SchedulerManager {
* @return array
* Array of plugin objects, keyed by the entity type the plugin supports.
*/
public function getPlugins(string $provider = NULL) {
public function getPlugins(?string $provider = NULL) {
$cache = \Drupal::cache()->get('scheduler.plugins');
if (!empty($cache) && !empty($cache->data) && empty($provider)) {
return $cache->data;
......@@ -1008,7 +1008,7 @@ class SchedulerManager {
* @return array
* A list of the entity type ids.
*/
public function getPluginEntityTypes(string $provider = NULL) {
public function getPluginEntityTypes(?string $provider = NULL) {
return array_keys($this->getPlugins($provider));
}
......
......@@ -184,7 +184,7 @@ trait SchedulerCommerceProductSetupTrait {
* @return \Drupal\commerce_product\Entity\ProductInterface
* The commerce product object.
*/
public function getProduct(string $name = NULL) {
public function getProduct(?string $name = NULL) {
$query = $this->productStorage->getQuery()
->accessCheck(FALSE)
->sort('product_id', 'DESC');
......
......@@ -180,7 +180,7 @@ trait SchedulerMediaSetupTrait {
* @return \Drupal\media\MediaInterface
* The media object.
*/
public function getMediaItem(string $name = NULL) {
public function getMediaItem(?string $name = NULL) {
$query = $this->mediaStorage->getQuery()
->accessCheck(FALSE)
->sort('mid', 'DESC');
......
......@@ -244,7 +244,7 @@ trait SchedulerSetupTrait {
* @return \Drupal\Core\Entity\EntityInterface
* The created entity object.
*/
public function createEntity(string $entityTypeId, string $bundle = NULL, array $values = []) {
public function createEntity(string $entityTypeId, ?string $bundle = NULL, array $values = []) {
switch ($entityTypeId) {
case 'node':
......@@ -329,7 +329,7 @@ trait SchedulerSetupTrait {
* @return \Drupal\Core\Entity\EntityTypeInterface
* The stored entity type object.
*/
public function entityTypeObject(string $entityTypeId, string $bundle = NULL) {
public function entityTypeObject(string $entityTypeId, ?string $bundle = NULL) {
if (empty($bundle) || $bundle == 'non-enabled') {
$default_types = [
'node' => $this->type,
......@@ -448,7 +448,7 @@ trait SchedulerSetupTrait {
* @return \Drupal\Core\Url
* The url object for adding the required entity.
*/
public function entityAddUrl(string $entityTypeId, string $bundle = NULL) {
public function entityAddUrl(string $entityTypeId, ?string $bundle = NULL) {
switch ($entityTypeId) {
case 'node':
$bundle = ($bundle == 'non-enabled') ? $this->nonSchedulerType : ($bundle ?? $this->type);
......
......@@ -152,7 +152,7 @@ trait SchedulerTaxonomyTermSetupTrait {
* @return \Drupal\taxonomy\Entity\Term
* The taxonomy term object.
*/
public function getTaxonomyTerm(string $name = NULL) {
public function getTaxonomyTerm(?string $name = NULL) {
$query = $this->taxonomyTermStorage->getQuery()
->accessCheck(FALSE)
->sort('tid', 'DESC');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment