From aaa428946a356fbf8f6e74ab55f7eb43a32f7e3e Mon Sep 17 00:00:00 2001 From: MaurizioMoreo <51058637+MaurizioMoreo@users.noreply.github.com> Date: Wed, 19 Apr 2023 09:20:42 +0200 Subject: [PATCH] Php82 (#19) * Rename Xdebug host config parameter * Update PHP, composer and Xdebug * Solve deprecated function * Add AllowDynamicProperties attribute * Solve AvroDataIOWriter dynamic creation * Solve dynamic creation (protocol, messages) in AvroProtocol * Solve dynamic creations in AvroSchema * Solve dynamic creations in AvroProtocolMessage --- Dockerfile | 10 +++++----- Makefile | 6 +++--- lib/avro/data_file.php | 2 ++ lib/avro/protocol.php | 4 ++++ lib/avro/schema.php | 9 ++++----- test/DataFileTest.php | 2 +- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 999b9fe..4cbcf8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -ARG PHP_VERSION=8.0 +ARG PHP_VERSION=8.2 FROM php:${PHP_VERSION}-cli-alpine -ARG XDEBUG_VERSION=3.1.3 - -RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ +ARG XDEBUG_VERSION=3.2.0 +RUN apk add --update linux-headers \ + && apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ && apk add --no-cache --virtual .runtime-deps git libzip-dev gmp-dev \ && docker-php-ext-install zip gmp \ && pecl install xdebug-$XDEBUG_VERSION \ && docker-php-ext-enable xdebug \ && echo "xdebug.max_nesting_level=15000" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ - && echo "xdebug.remote_host=localhost" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ + && echo "xdebug.client_host=localhost" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ && echo "xdebug.idekey=PHPSTORM" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ && echo "xdebug.remote_handler=dbgp" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ && echo "xdebug.mode=develop" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ diff --git a/Makefile b/Makefile index e0c85b4..2960abb 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,10 @@ MAKEFLAGS =+ -rR --warn-undefined-variables .PHONY: composer-install composer-update examples docker run COMPOSER ?= bin/composer.phar -COMPOSER_VERSION ?= 2.2.7 +COMPOSER_VERSION ?= 2.5.4 PHP ?= bin/php -PHP_VERSION ?= 8.0 -XDEBUG_VERSION ?= 3.1.3 +PHP_VERSION ?= 8.2 +XDEBUG_VERSION ?= 3.2.0 export diff --git a/lib/avro/data_file.php b/lib/avro/data_file.php index b045d30..1d9cb7a 100644 --- a/lib/avro/data_file.php +++ b/lib/avro/data_file.php @@ -490,6 +490,8 @@ private static function generate_sync_marker() */ private $codec; + private $sync_marker; + /** * @param AvroIO $io * @param AvroIODatumWriter $datum_writer diff --git a/lib/avro/protocol.php b/lib/avro/protocol.php index acf1ece..e9b743a 100644 --- a/lib/avro/protocol.php +++ b/lib/avro/protocol.php @@ -27,6 +27,8 @@ */ class AvroProtocol { + private $protocol; + private $messages; public $name; public $namespace; public $schemata; @@ -82,6 +84,8 @@ class AvroProtocolMessage public $response; + private $name; + /** * AvroProtocolMessage constructor. * @param $name diff --git a/lib/avro/schema.php b/lib/avro/schema.php index e566608..0d7c1d0 100644 --- a/lib/avro/schema.php +++ b/lib/avro/schema.php @@ -233,6 +233,10 @@ class AvroSchema */ const LOGICAL_TYPE_ATTR = 'logicalType'; + public $type; + protected $extra_attributes; + protected $logical_type; + /** * @var array list of primitive schema type names */ @@ -1519,11 +1523,6 @@ private static function check_order_value($order) */ private $doc; - /** - * @var string logical type of this field - */ - private $logical_type; - /** * @var int precision of the logical type */ diff --git a/test/DataFileTest.php b/test/DataFileTest.php index 2014f0b..b10396e 100644 --- a/test/DataFileTest.php +++ b/test/DataFileTest.php @@ -30,7 +30,7 @@ class DataFileTest extends \PHPUnit\Framework\TestCase /** * @return string */ - static function current_timestamp() { return strftime("%Y%m%dT%H%M%S"); } + static function current_timestamp() { return date("Ymd\THis"); } /** * @param $data_file