Skip to content

Commit 5f1ac52

Browse files
committed
[FIX] Don't remove but deprecate Functions and Constants (#49)
1 parent 46b65d7 commit 5f1ac52

File tree

8 files changed

+865
-7
lines changed

8 files changed

+865
-7
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
return (new PhpCsFixer\Config())
1010
->setRules(
1111
[
12+
'@PSR2' => true,
1213
'no_unused_imports' => true,
1314
'ordered_imports' => [
1415
'sort_algorithm' => 'alpha',

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
"autoload": {
3838
"psr-4": {
3939
"FlixTech\\SchemaRegistryApi\\": "src/"
40-
}
40+
},
41+
"files": [
42+
"src/Requests/Functions.php",
43+
"src/Constants/Constants.php"
44+
]
4145
},
4246
"autoload-dev": {
4347
"psr-4": {

src/Constants/Constants.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
namespace FlixTech\SchemaRegistryApi\Constants;
4+
5+
/**
6+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_NONE instead
7+
*/
8+
const COMPATIBILITY_NONE = 'NONE';
9+
10+
/**
11+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_BACKWARD instead
12+
*/
13+
const COMPATIBILITY_BACKWARD = 'BACKWARD';
14+
15+
/**
16+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_BACKWARD instead
17+
*/
18+
const COMPATIBILITY_BACKWARD_TRANSITIVE = 'BACKWARD_TRANSITIVE';
19+
20+
/**
21+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_FORWARD instead
22+
*/
23+
const COMPATIBILITY_FORWARD = 'FORWARD';
24+
25+
/**
26+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_FORWARD_TRANSITIVE instead
27+
*/
28+
const COMPATIBILITY_FORWARD_TRANSITIVE = 'FORWARD_TRANSITIVE';
29+
30+
/**
31+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_FULL instead
32+
*/
33+
const COMPATIBILITY_FULL = 'FULL';
34+
35+
/**
36+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::COMPATIBILITY_FULL_TRANSITIVE instead
37+
*/
38+
const COMPATIBILITY_FULL_TRANSITIVE = 'FULL_TRANSITIVE';
39+
40+
/**
41+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::VERSION_LATEST instead
42+
*/
43+
const VERSION_LATEST = 'latest';
44+
45+
/**
46+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::ACCEPT instead
47+
*/
48+
const ACCEPT = 'Accept';
49+
50+
/**
51+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::ACCEPT_HEADER instead
52+
*/
53+
const ACCEPT_HEADER = [ACCEPT => 'application/vnd.schemaregistry.v1+json'];
54+
55+
/**
56+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::CONTENT_TYPE instead
57+
*/
58+
const CONTENT_TYPE = 'Content-Type';
59+
60+
/**
61+
* @deprecated Use \FlixTech\SchemaRegistryApi\Constants::CONTENT_TYPE_HEADER instead
62+
*/
63+
const CONTENT_TYPE_HEADER = [CONTENT_TYPE => 'application/vnd.schemaregistry.v1+json'];

src/Registry/Cache/SimpleCacheAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public function getWithId(int $schemaId): ?AvroSchema
7676
public function getIdWithHash(string $hash): ?int
7777
{
7878
$rawId = $this->cache->get($hash);
79-
79+
8080
if (null === $rawId) {
8181
return null;
8282
}
83-
83+
8484
return (int) $rawId;
8585
}
8686

0 commit comments

Comments
 (0)