Add deprecations

This commit is contained in:
Jaapio
2022-10-28 16:41:00 +02:00
parent 25d696587f
commit b12a33921b
8 changed files with 12 additions and 2 deletions
+1
View File
@@ -92,6 +92,7 @@ final class Method extends BaseTag implements Factory\StaticMethod
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): ?self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::stringNotEmpty($body);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);
+4
View File
@@ -58,12 +58,16 @@ final class Param extends TagWithType implements Factory\StaticMethod
$this->isReference = $isReference;
}
/**
* @deprecated Create using static factory is deprecated, this method should not be called directly by library consumers
*/
public static function create(
string $body,
?TypeResolver $typeResolver = null,
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::stringNotEmpty($body);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);
+1
View File
@@ -53,6 +53,7 @@ final class Property extends TagWithType implements Factory\StaticMethod
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::stringNotEmpty($body);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);
+1
View File
@@ -53,6 +53,7 @@ final class PropertyRead extends TagWithType implements Factory\StaticMethod
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::stringNotEmpty($body);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);
+1
View File
@@ -53,6 +53,7 @@ final class PropertyWrite extends TagWithType implements Factory\StaticMethod
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::stringNotEmpty($body);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);
+1
View File
@@ -38,6 +38,7 @@ final class Return_ extends TagWithType implements Factory\StaticMethod
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);
+1
View File
@@ -53,6 +53,7 @@ final class Var_ extends TagWithType implements Factory\StaticMethod
?DescriptionFactory $descriptionFactory = null,
?TypeContext $context = null
): self {
trigger_error('Create using static factory is deprecated, this method should not be called directly by library consumers', E_USER_DEPRECATED);
Assert::stringNotEmpty($body);
Assert::notNull($typeResolver);
Assert::notNull($descriptionFactory);