Skip to content

Commit 19d093f

Browse files
committed
implicit nullable is deprecated
1 parent 75eb9d6 commit 19d093f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/EDI/Analyser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function loadMultiSegmentsXml(array $segmentXmlFiles)
166166
* @param array|null $rawSegments (optional) List of raw segments from EDI\Parser::getRawSegments
167167
* @return string file
168168
*/
169-
public function process(array $data, array $rawSegments = null): string
169+
public function process(array $data, ?array $rawSegments = null): string
170170
{
171171
$r = [];
172172
foreach ($data as $nrow => $segment) {

src/EDI/Interpreter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class Interpreter
9191
private $serviceSeg;
9292

9393
/**
94-
* @var array
94+
* @var array|null
9595
*/
96-
private $codes;
96+
private $codes = null;
9797

9898
/**
9999
* @var callable
@@ -126,9 +126,9 @@ class Interpreter
126126
* @param string $xmlMsg Path to XML Message representation
127127
* @param array $xmlSeg Segments processed by EDI\Analyser::loadSegmentsXml or EDI\Mapping\MappingProvider
128128
* @param array $xmlSvc Service segments processed by EDI\Analyser::loadSegmentsXml or EDI\Mapping\MappingProvider
129-
* @param array|null $messageTextConf Personalisation of error messages
129+
* @param array|null $messageTextConf Personalization of error messages
130130
*/
131-
public function __construct(string $xmlMsg, array $xmlSeg, array $xmlSvc, array $messageTextConf = null)
131+
public function __construct(string $xmlMsg, array $xmlSeg, array $xmlSvc, ?array $messageTextConf = null)
132132
{
133133
// simplexml_load_file: This can be affected by a PHP bug #62577 (https://bugs.php.net/bug.php?id=62577)
134134
$xmlData = \file_get_contents($xmlMsg);
@@ -735,7 +735,7 @@ private function doAddArray(array &$array, array &$jsonMessage, $maxRepeat = 1)
735735
*
736736
* @param int|null $segmentIdx
737737
*/
738-
private function processSegment(array &$segment, array &$xmlMap, $segmentIdx, array &$errors = null): array
738+
private function processSegment(array &$segment, array &$xmlMap, $segmentIdx, ?array &$errors = null): array
739739
{
740740
$id = $segment[0];
741741

src/EDI/Reader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ public function readEdiDataValueReq($filter, int $l1, $l2 = false)
172172
* @param int $l1 first level item number (start by 1)
173173
* @param false|int $l2 second level item number (start by 0)
174174
* @param bool $required if required, but no exist, register error
175+
* @param int|null $offset if multiple segments found, get segment by offset
175176
* @return string|null
176177
*/
177-
public function readEdiDataValue($filter, int $l1, $l2 = false, bool $required = false, int $offset = null)
178+
public function readEdiDataValue($filter, int $l1, $l2 = false, bool $required = false, ?int $offset = null)
178179
{
179180
$found_segments = [];
180181
$segment_name = $filter;

0 commit comments

Comments
 (0)