Skip to content

Commit d0f9a9d

Browse files
authored
Drop PHP 7.1 and allow beberlei/assert version 3.0 (#30)
* [CI] Drop PHP 7.1 from build environment * [SR] Adding `public` keyword to constants in exception classes * [UR] Adding return types to `CacheAdapter` and implementations * [UR] Use `static` functions where possible and add more return types
1 parent 7591964 commit d0f9a9d

28 files changed

+201
-126
lines changed

.travis.yml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ services:
66
- docker
77

88
php:
9-
- '7.1'
109
- '7.2'
1110
- '7.3'
1211

@@ -43,7 +42,7 @@ jobs:
4342
env:
4443
- DEPENDENCIES="stable"
4544
- INTEGRATION_TEST="enabled"
46-
- CONFLUENT_VERSION=3.1.2
45+
- CONFLUENT_VERSION=3.3.3
4746
script:
4847
- make platform
4948
- PHP=php make phpunit-integration
@@ -52,7 +51,7 @@ jobs:
5251
env:
5352
- DEPENDENCIES="stable"
5453
- INTEGRATION_TEST="enabled"
55-
- CONFLUENT_VERSION=3.2.4
54+
- CONFLUENT_VERSION=4.1.3
5655
script:
5756
- make platform
5857
- PHP=php make phpunit-integration
@@ -61,7 +60,7 @@ jobs:
6160
env:
6261
- DEPENDENCIES="stable"
6362
- INTEGRATION_TEST="enabled"
64-
- CONFLUENT_VERSION=3.3.2
63+
- CONFLUENT_VERSION=5.2.3
6564
script:
6665
- make platform
6766
- PHP=php make phpunit-integration
@@ -70,25 +69,7 @@ jobs:
7069
env:
7170
- DEPENDENCIES="stable"
7271
- INTEGRATION_TEST="enabled"
73-
- CONFLUENT_VERSION=4.0.2
74-
script:
75-
- make platform
76-
- PHP=php make phpunit-integration
77-
- stage: integration
78-
php: '7.2'
79-
env:
80-
- DEPENDENCIES="stable"
81-
- INTEGRATION_TEST="enabled"
82-
- CONFLUENT_VERSION=4.1.2
83-
script:
84-
- make platform
85-
- PHP=php make phpunit-integration
86-
- stage: integration
87-
php: '7.2'
88-
env:
89-
- DEPENDENCIES="stable"
90-
- INTEGRATION_TEST="enabled"
91-
- CONFLUENT_VERSION=5.0.0
72+
- CONFLUENT_VERSION=latest
9273
script:
9374
- make platform
9475
- PHP=php make phpunit-integration

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG PHP_VERSION=7.1
1+
ARG PHP_VERSION=7.2
22

33
FROM php:${PHP_VERSION}-cli-alpine
44

5-
ARG XDEBUG_VERSION=2.7.0RC1
5+
ARG XDEBUG_VERSION=2.7.2
66

77
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
88
&& apk add --no-cache --virtual .runtime-deps git libzip-dev \

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ COMPOSER ?= bin/composer.phar
1212
COMPOSER_VERSION ?= 1.8.3
1313
PHP ?= bin/php
1414
PHP_VERSION ?= 7.2
15-
XDEBUG_VERSION ?= 2.7.0RC1
15+
XDEBUG_VERSION ?= 2.7.2
1616

1717
export
1818

bin/php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ command -v docker >/dev/null 2>&1 || { echo "docker is required to run this bina
77
USER=${USER:-$( id -un )}
88
GROUP=${GROUP:-$( id -gn )}
99
COMPOSER_HOME=${COMPOSER_HOME:-${HOME}/.composer}
10-
PHP_VERSION=${PHP_VERSION:-7.1}
10+
PHP_VERSION=${PHP_VERSION:-7.2}
1111
DOCKER_OPTS=${DOCKER_OPTS:-'-it'}
1212

1313
exec docker run ${DOCKER_OPTS} --rm \

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flix-tech/confluent-schema-registry-api",
3-
"description": "A PHP 7.0+ library to consume the Confluent Schema Registry REST API.",
3+
"description": "A PHP 7.2+ library to consume the Confluent Schema Registry REST API.",
44
"minimum-stability": "stable",
55
"type": "library",
66
"license": "MIT",
@@ -11,9 +11,11 @@
1111
}
1212
],
1313
"require": {
14-
"php": "~7.1",
14+
"php": "^7.2",
15+
"ext-curl": "*",
16+
"ext-json": "*",
1517
"guzzlehttp/guzzle": "~6.3",
16-
"beberlei/assert": "~2.7",
18+
"beberlei/assert": "~2.7|~3.0",
1719
"flix-tech/avro-php": "^3.0"
1820
},
1921
"require-dev": {

src/Exception/AbstractSchemaRegistryException.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44

55
namespace FlixTech\SchemaRegistryApi\Exception;
66

7-
abstract class AbstractSchemaRegistryException extends \RuntimeException implements SchemaRegistryException
7+
use LogicException;
8+
use RuntimeException;
9+
10+
abstract class AbstractSchemaRegistryException extends RuntimeException implements SchemaRegistryException
811
{
9-
const ERROR_CODE = 0;
12+
public const ERROR_CODE = 0;
1013

1114
final public static function errorCode(): int
1215
{
1316
if (!defined('static::ERROR_CODE') || 0 === static::ERROR_CODE) {
14-
throw new \LogicException(sprintf('Class "%s" must define constant `ERROR_CODE`', static::class));
17+
throw new LogicException(sprintf('Class "%s" must define constant `ERROR_CODE`', static::class));
1518
}
1619

1720
return static::ERROR_CODE;

src/Exception/BackendDataStoreException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
class BackendDataStoreException extends AbstractSchemaRegistryException
88
{
9-
const ERROR_CODE = 50001;
9+
public const ERROR_CODE = 50001;
1010
}

src/Exception/IncompatibleAvroSchemaException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
class IncompatibleAvroSchemaException extends AbstractSchemaRegistryException
88
{
9-
const ERROR_CODE = 409;
9+
public const ERROR_CODE = 409;
1010
}

src/Exception/InvalidAvroSchemaException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
class InvalidAvroSchemaException extends AbstractSchemaRegistryException
88
{
9-
const ERROR_CODE = 42201;
9+
public const ERROR_CODE = 42201;
1010
}

src/Exception/InvalidCompatibilityLevelException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
class InvalidCompatibilityLevelException extends AbstractSchemaRegistryException
88
{
9-
const ERROR_CODE = 42203;
9+
public const ERROR_CODE = 42203;
1010
}

0 commit comments

Comments
 (0)