Skip to content

Commit

Permalink
fix(deps): removed doctrine/annotations and use (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: Lewis Torrington <lewis.torrington@upcloud.com>
  • Loading branch information
lu1a and Lewis Torrington authored Mar 24, 2023
1 parent c1308eb commit 9f63b9e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ git_push.sh
.vscode
/phpunit.xml
/composer.lock
.phpunit.result.cache
21 changes: 14 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -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"
}
}
3 changes: 1 addition & 2 deletions lib/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()]);
Expand Down

0 comments on commit 9f63b9e

Please sign in to comment.