Skip to content

Commit

Permalink
Merge pull request #223 from gsteel/deprecate-db
Browse files Browse the repository at this point in the history
Deprecate `laminas-db` related validators
  • Loading branch information
Ocramius authored Jan 3, 2024
2 parents c7a7844 + a46d127 commit 9833025
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/book/validators/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
a means to test whether a record exists in a given table of a database, with a
given value.

<!-- markdownlint-disable-next-line MD001 -->
> ### Installation requirements
> ## Deprecated
>
> `laminas-db` has been marked as security only [since July 2022](https://github.com/laminas/technical-steering-committee/blob/main/meetings/minutes/2022-02-07-TSC-Minutes.md), as such, these validators have been deprecated for removal in version 3.0 of `laminas-validator`
> ## Installation requirements
>
> `Laminas\Validator\Db\NoRecordExists` and `Laminas\Validator\Db\RecordExists`
> depends on the laminas-db component, so be sure to have it installed before
Expand Down
14 changes: 14 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,20 @@
</TooManyArguments>
</file>
<file src="src/ValidatorPluginManager.php">
<DeprecatedClass>
<code>Db\NoRecordExists::class</code>
<code>Db\NoRecordExists::class</code>
<code>Db\NoRecordExists::class</code>
<code>Db\NoRecordExists::class</code>
<code>Db\NoRecordExists::class</code>
<code>Db\NoRecordExists::class</code>
<code>Db\RecordExists::class</code>
<code>Db\RecordExists::class</code>
<code>Db\RecordExists::class</code>
<code>Db\RecordExists::class</code>
<code>Db\RecordExists::class</code>
<code>Db\RecordExists::class</code>
</DeprecatedClass>
<DeprecatedMethod>
<code>getServiceLocator</code>
<code>getServiceLocator</code>
Expand Down
9 changes: 9 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,13 @@
<stubs>
<file name=".psr-container.php.stub" preloadClasses="true" />
</stubs>

<issueHandlers>
<DeprecatedClass>
<errorLevel type="suppress">
<directory name="src/Db" />
<directory name="test/Db" />
</errorLevel>
</DeprecatedClass>
</issueHandlers>
</psalm>
2 changes: 2 additions & 0 deletions src/Db/AbstractDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

/**
* Class for Database record validation
*
* @deprecated This class will be removed in version 3.0 of this component. There is no replacement.
*/
abstract class AbstractDb extends AbstractValidator implements AdapterAwareInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Db/NoRecordExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Confirms a record does not exist in a table.
*
* @deprecated This class will be removed in version 3.0 of this component. There is no replacement.
*/
class NoRecordExists extends AbstractDb
{
Expand Down
2 changes: 2 additions & 0 deletions src/Db/RecordExists.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/**
* Confirms a record exists in a table.
*
* @deprecated This class will be removed in version 3.0 of this component. There is no replacement.
*/
class RecordExists extends AbstractDb
{
Expand Down

0 comments on commit 9833025

Please sign in to comment.