Skip to content

Commit 80e4a9d

Browse files
committed
minor #13060 [2.7] adds deprecation notices. (hhamon)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7] adds deprecation notices. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #12608, #12672, #12675 #12684, #12686 | License | MIT | Doc PR | ~ Commits ------- f9fbb4f Fixes more deprecation notices as per @stof review. fd47c07 Fixed some deprecations according to @stof feedbacks. 2a3e7d2 Normalizes deprecation notice messages. 738b9be [Validator] fixes UuidValidator deprecated class namespace. e608ba6 [Form] adds more deprecation notices. cd9617a [Validator] adds more deprecation notices. a7f841e [Form] Adds a way to trigger deprecation notice on demand for VirtualFormAwareIterator class. 97efd2c Fixes more deprecation notices. fd9c7bb Normalized @deprecated annotations. 39cfd47 Removed deprecation notices from test files. 2a9749d Fixes deprecation notices. 6f57b7b Reverted trigger_error() function calls on deprecated interfaces to prevent breaking third party projects implementing them. 86b9f6b Adds deprecation notices for structures to be removed in 3.0.
2 parents bbc08c1 + 0819815 commit 80e4a9d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Session/Flash/FlashBag.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ public function clear()
169169
/**
170170
* Returns an iterator for flashes.
171171
*
172-
* @deprecated Will be removed in 3.0.
172+
* @deprecated since version 2.4, to be removed in 3.0.
173173
*
174174
* @return \ArrayIterator An \ArrayIterator instance
175175
*/
176176
public function getIterator()
177177
{
178+
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
179+
178180
return new \ArrayIterator($this->all());
179181
}
180182
}

Session/Storage/Handler/LegacyPdoSessionHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
1313

14+
trigger_error('The '.__NAMESPACE__.'\LegacyPdoSessionHandler class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler class instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* Session handler using a PDO connection to read and write data.
1618
*
@@ -24,7 +26,7 @@
2426
* @author Michael Williams <michael.williams@funsational.com>
2527
* @author Tobias Schultze <http://tobion.de>
2628
*
27-
* @deprecated Deprecated since version 2.6, to be removed in 3.0. Use
29+
* @deprecated since version 2.6, to be removed in 3.0. Use
2830
* {@link PdoSessionHandler} instead.
2931
*/
3032
class LegacyPdoSessionHandler implements \SessionHandlerInterface
@@ -77,8 +79,6 @@ public function __construct(\PDO $pdo, array $dbOptions = array())
7779
throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__));
7880
}
7981

80-
trigger_error('"Symfony\Component\HttpFoundation\Session\Storage\Handler\LegacyPdoSessionHandler" is deprecated since version 2.6 and will be removed in 3.0. Use "Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler" instead.', E_USER_DEPRECATED);
81-
8282
$this->pdo = $pdo;
8383
$dbOptions = array_merge(array(
8484
'db_id_col' => 'sess_id',

0 commit comments

Comments
 (0)