Skip to content

Commit 1b25f2b

Browse files
authored
Merge pull request #8 from veewee/native_function_invocation
PERF: Add native function invocations
2 parents e65511a + 1155910 commit 1b25f2b

File tree

10 files changed

+26
-1
lines changed

10 files changed

+26
-1
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@
5353
'static_lambda' => true,
5454
'strict_comparison' => true,
5555
'strict_param' => true,
56+
'native_function_invocation' => true,
5657
])
5758
;

src/Decoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Soap\Engine\Metadata\Metadata;
1111
use Soap\WsdlReader\Model\Definitions\BindingUse;
1212
use Soap\WsdlReader\Model\Definitions\Namespaces;
13+
use function count;
1314
use function Psl\Type\non_empty_string;
1415
use function Psl\Vec\map;
1516

src/Encoder/ObjectEncoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Soap\Engine\Metadata\Model\XsdType;
1717
use VeeWee\Reflecta\Iso\Iso;
1818
use VeeWee\Reflecta\Lens\Lens;
19+
use function is_array;
1920
use function Psl\Dict\map;
2021
use function Psl\Dict\pull;
2122
use function Psl\Dict\reindex;

src/Encoder/SimpleType/ScalarTypeEncoder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
use Soap\Encoding\Encoder\XmlEncoder;
99
use Soap\Encoding\Exception\RestrictionException;
1010
use VeeWee\Reflecta\Iso\Iso;
11+
use function is_bool;
12+
use function is_float;
13+
use function is_int;
14+
use function is_string;
1115

1216
/**
1317
* @implements XmlEncoder<mixed, string>

src/Encoder/SimpleType/SimpleListEncoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Soap\Encoding\Restriction\WhitespaceRestriction;
1010
use Soap\Engine\Metadata\Model\TypeMeta;
1111
use VeeWee\Reflecta\Iso\Iso;
12+
use function is_string;
1213
use function Psl\Vec\filter;
1314
use function Psl\Vec\map;
1415

src/Encoder/SoapEnc/SoapArrayEncoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use VeeWee\Reflecta\Iso\Iso;
2121
use VeeWee\Xml\Dom\Document;
2222
use XMLWriter;
23+
use function count;
2324
use function Psl\Vec\map;
2425
use function VeeWee\Xml\Dom\Locator\Element\children as readChildren;
2526
use function VeeWee\Xml\Writer\Builder\children;

src/Exception/RestrictionException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Psl\Str;
88
use Soap\Encoding\Formatter\QNameFormatter;
99
use Soap\Engine\Metadata\Model\XsdType;
10+
use function is_scalar;
1011

1112
final class RestrictionException extends InvalidArgumentException implements ExceptionInterface
1213
{

src/Normalizer/PhpPropertyNameNormalizer.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
namespace Soap\Encoding\Normalizer;
55

6+
use function array_filter;
7+
use function array_map;
8+
use function array_shift;
9+
use function array_unshift;
10+
use function count;
11+
use function preg_split;
612
use function Psl\Type\non_empty_string;
713

814
final class PhpPropertyNameNormalizer
@@ -18,8 +24,12 @@ public static function normalize(string $name): string
1824
private static function camelCase(string $word, string $regexp):string
1925
{
2026
$parts = array_filter(preg_split($regexp, $word));
27+
if (count($parts) === 1) {
28+
return $word;
29+
}
30+
2131
$keepUnchanged = array_shift($parts);
22-
$parts = array_map('ucfirst', $parts);
32+
$parts = array_map(\ucfirst(...), $parts);
2333
array_unshift($parts, $keepUnchanged);
2434

2535
return non_empty_string()->assert(

src/TypeInference/XsiTypeDetector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
use Soap\WsdlReader\Parser\Xml\QnameParser;
1212
use Soap\Xml\Xmlns as SoapXmlns;
1313
use VeeWee\Xml\Xmlns\Xmlns;
14+
use function is_bool;
15+
use function is_float;
16+
use function is_int;
17+
use function is_string;
1418
use function Psl\Option\none;
1519
use function Psl\Option\some;
1620

src/Xml/Reader/DocumentToLookupArrayReader.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
namespace Soap\Encoding\Xml\Reader;
55

66
use VeeWee\Xml\Dom\Document;
7+
use function array_key_exists;
78
use function VeeWee\Xml\Dom\Locator\Attribute\attributes_list;
89
use function VeeWee\Xml\Dom\Locator\Element\children as readChildElements;
910

0 commit comments

Comments
 (0)