Skip to content

Commit

Permalink
Merge pull request #13 from spiral/deprecations
Browse files Browse the repository at this point in the history
Deprecate annotations
  • Loading branch information
butschster committed Dec 8, 2023
2 parents aa45e59 + 462af66 commit 1c990f2
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 3 deletions.
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
"require-dev": {
"doctrine/annotations": "^1.12 || ^2.0",
"jetbrains/phpstorm-attributes": "^1.0",
"symfony/var-dumper": "^5.2 || ^6.0",
"phpunit/phpunit": "^9.5.20",
"vimeo/psalm": "^4.21"
"vimeo/psalm": "^5.17"
},
"autoload": {
"files": [
Expand All @@ -50,7 +49,7 @@
]
},
"suggest": {
"doctrine/annotations": "^1.0 for Doctrine metadata driver support"
"doctrine/annotations": "^1.0 || ^2.0 for Doctrine metadata driver support"
},
"config": {
"sort-packages": true
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
Expand Down
3 changes: 3 additions & 0 deletions src/AnnotationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Spiral\Attributes\Internal\Decorator;
use Spiral\Attributes\Internal\DoctrineAnnotationReader;

/**
* @deprecated Use {@see AttributeReader} instead.
*/
final class AnnotationReader extends Decorator
{
public function __construct(Reader $reader = null)
Expand Down
1 change: 1 addition & 0 deletions src/Bridge/DoctrineReaderBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* //
* $doctrine = new \Doctrine\Common\Annotations\CachedReader($bridge, $cache);
* </code>
* @deprecated
*/
final class DoctrineReaderBridge implements Reader
{
Expand Down
3 changes: 3 additions & 0 deletions src/Exception/InitializationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Spiral\Attributes\Exception;

/**
* @deprecated
*/
class InitializationException extends AttributeException
{
}
3 changes: 3 additions & 0 deletions src/Exception/NotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Spiral\Attributes\Exception;

/**
* @deprecated
*/
class NotFoundException extends AttributeException
{
}
3 changes: 3 additions & 0 deletions src/Exception/SyntaxAttributeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Spiral\Attributes\Exception;

/**
* @deprecated
*/
class SyntaxAttributeException extends AttributeException
{
}
3 changes: 3 additions & 0 deletions src/Internal/DoctrineAnnotationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use Spiral\Attributes\Exception\SyntaxAttributeException;
use Spiral\Attributes\Reader as BaseReader;

/**
* @deprecated
*/
final class DoctrineAnnotationReader extends BaseReader
{
private Reader $reader;
Expand Down
1 change: 1 addition & 0 deletions src/Internal/Instantiator/DoctrineInstantiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/**
* @internal DoctrineInstantiator is an internal library class, please do not use it in your code.
* @psalm-internal Spiral\Attributes
* @deprecated Use {@see NamedArgumentsInstantiator} instead.
*/
final class DoctrineInstantiator extends Instantiator
{
Expand Down
1 change: 1 addition & 0 deletions src/NamedArgumentConstructor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
* @Annotation
* @Target({ "CLASS" })
* @deprecated
*/
#[\Attribute(\Attribute::TARGET_CLASS)]
final class NamedArgumentConstructor extends DoctrineNamedArgumentConstructor
Expand Down
1 change: 1 addition & 0 deletions src/NamedArgumentConstructorAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/**
* Marker interface for PHP7/PHP8 compatible support for named arguments
* (and constructor property promotion).
* @deprecated
*/
interface NamedArgumentConstructorAttribute extends NamedArgumentConstructorAnnotation
{
Expand Down

0 comments on commit 1c990f2

Please sign in to comment.