Replace tightenco/collect with illuminate/collections

Fixes #417
This commit is contained in:
Oliver Davies 2021-04-23 08:58:14 +01:00
parent 7f39c01d87
commit e9c2f2a2b0
12 changed files with 212 additions and 67 deletions

View file

@ -7,7 +7,7 @@ namespace Drupal\opdavies_blog\Entity\Node;
use Drupal\discoverable_entity_bundle_classes\ContentEntityBundleInterface;
use Drupal\node\Entity\Node;
use Drupal\taxonomy\Entity\Term;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* Defines an blog post node class.

View file

@ -10,7 +10,7 @@ use Drupal\Core\Routing\CurrentRouteMatch;
use Drupal\opdavies_blog\Entity\Node\Post;
use Drupal\opdavies_blog\Repository\RelatedPostsRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* @Block(

View file

@ -6,7 +6,7 @@ namespace Drupal\opdavies_blog\Repository;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
final class PostRepository {

View file

@ -10,7 +10,7 @@ use Drupal\Core\Entity\Query\QueryInterface;
use Drupal\node\NodeInterface;
use Drupal\opdavies_blog\Entity\Node\Post;
use Drupal\taxonomy\TermInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
final class RelatedPostsRepository {

View file

@ -12,7 +12,7 @@ use Drupal\node\Entity\Node;
use Drupal\opdavies_blog\Entity\Node\Post;
use Drupal\taxonomy\Entity\Term;
use Drupal\taxonomy\TermInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
final class PostFactory {

View file

@ -6,7 +6,7 @@ namespace Drupal\opdavies_talks\Collection;
use Drupal\opdavies_talks\Entity\Node\Talk;
use Drupal\paragraphs\ParagraphInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
final class TalkCollection extends Collection {

View file

@ -5,7 +5,7 @@ namespace Drupal\opdavies_talks\Entity\Node;
use Drupal\discoverable_entity_bundle_classes\ContentEntityBundleInterface;
use Drupal\node\Entity\Node;
use Drupal\paragraphs\ParagraphInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* Defines an talk node class.

View file

@ -10,7 +10,7 @@ use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\opdavies_talks\Entity\Node\Talk;
use Drupal\paragraphs\ParagraphInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
/**
* Update a talk node before it's saved.
@ -44,6 +44,7 @@ final class UpdateTalkNodeBeforeSave implements EventSubscriberInterface {
// If the original event IDs don't match the sorted event IDs, update the
// event field to use the sorted ones.
// @phpstan-ignore-next-line
if ($events->map->id() != $eventsByDate->map->id()) {
$talk->setEvents($eventsByDate->toArray());
}

View file

@ -6,7 +6,7 @@ namespace Drupal\Tests\opdavies_talks\Kernel;
use Carbon\Carbon;
use Drupal\views\ResultRow;
use Tightenco\Collect\Support\Collection;
use Illuminate\Support\Collection;
final class TalksPageSortTest extends TalksTestBase {