From e80e5dc7b4859726b15cd42c7c67a94f36122835 Mon Sep 17 00:00:00 2001 From: Toni Uebernickel Date: Tue, 1 Dec 2015 08:04:34 +0100 Subject: [PATCH] [DomCrawler] add upgrade hint on interface changes --- UPGRADE-3.0.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index e15b0d3d8310f..455f16aa31783 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -105,6 +105,22 @@ UPGRADE FROM 2.x to 3.0 removed: `ContainerBuilder::synchronize()`, `Definition::isSynchronized()`, and `Definition::setSynchronized()`. +### DomCrawler + + * The interface of the `Symfony\Component\DomCrawler\Crawler` changed. It does no longer implement `\Iterator` but `\IteratorAggregate`. If you rely on methods of the `\Iterator` interface, call the `getIterator` method of the `\IteratorAggregate` interface before. No changes are required in a `\Traversable`-aware control structure, such as `foreach`. + + Before: + + ```php + $crawler->current(); + ``` + + After: + + ```php + $crawler->getIterator()->current(); + ``` + ### EventDispatcher * The method `getListenerPriority($eventName, $listener)` has been added to the