From 9f63b9e2abc46322d56f2a55a2da73baa5d603b9 Mon Sep 17 00:00:00 2001 From: Lewis <83420438+lu1a@users.noreply.github.com> Date: Fri, 24 Mar 2023 13:02:59 +0200 Subject: [PATCH] fix(deps): removed doctrine/annotations and use (#49) Co-authored-by: Lewis Torrington --- .gitignore | 1 + composer.json | 21 ++++++++++++++------- lib/Serializer.php | 3 +-- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 05d916a3..50bcb840 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ git_push.sh .vscode /phpunit.xml /composer.lock +.phpunit.result.cache diff --git a/composer.json b/composer.json index 81237c43..516f9f04 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,12 @@ { "name": "upcloudltd/upcloud-php-api", "description": "UpCloud PHP API", - "keywords": ["php", "sdk", "api", "upcloud"], + "keywords": [ + "php", + "sdk", + "api", + "upcloud" + ], "homepage": "https://github.com/UpCloudLtd/upcloud-php-api", "license": "MIT", "authors": [ @@ -18,21 +23,23 @@ "guzzlehttp/guzzle": "^7.1", "symfony/serializer": "^5.1", "symfony/property-access": "^5.1", - "webmozart/assert": "^1.9", - "doctrine/annotations": "^1.11" + "webmozart/assert": "^1.9" }, "require-dev": { "phpunit/phpunit": "^8.5.8", "squizlabs/php_codesniffer": "~3.5", - "friendsofphp/php-cs-fixer": "~2.18.3", "mockery/mockery": "^1.3.3", "symfony/var-dumper": "^5.1" }, "autoload": { - "psr-4": { "Upcloud\\ApiClient\\": "lib/" } + "psr-4": { + "Upcloud\\ApiClient\\": "lib/" + } }, "autoload-dev": { - "psr-4": { "Upcloud\\Tests\\": "test/" } + "psr-4": { + "Upcloud\\Tests\\": "test/" + } }, "minimum-stability": "stable" -} +} \ No newline at end of file diff --git a/lib/Serializer.php b/lib/Serializer.php index aabb8f08..27ef77cd 100644 --- a/lib/Serializer.php +++ b/lib/Serializer.php @@ -4,7 +4,6 @@ namespace Upcloud\ApiClient; -use Doctrine\Common\Annotations\AnnotationReader; use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory; use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter; @@ -20,7 +19,7 @@ class Serializer implements SerializerInterface public function __construct() { - $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); + $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader()); $normalizer = new ObjectNormalizer($classMetadataFactory, new CamelCaseToSnakeCaseNameConverter()); $this->serializer = new BaseSerializer([$normalizer], [new JsonEncoder()]);