swaggest / php-json-schema

High definition PHP structures with JSON-schema based validation
MIT License
451 stars 51 forks source link

fix Trying to access array offset on value of type null (7.4) #101

Closed remicollet closed 4 years ago

remicollet commented 4 years ago

Without this fix

1) Swaggest\JsonSchema\Tests\PHPUnit\ClassStructure\ClassStructureTest::testAdditionalProperties
Trying to access array offset on value of type null

/dev/shm/BUILDROOT/php-swaggest-json-schema-0.12.27-1.fc31.remi.x86_64/usr/share/php/Swaggest/JsonSchema/Wrapper.php:108
/dev/shm/BUILDROOT/php-swaggest-json-schema-0.12.27-1.fc31.remi.x86_64/usr/share/php/Swaggest/JsonSchema/Structure/ClassStructureTrait.php:161
/dev/shm/BUILD/php-json-schema-9ec863a05a40e9b4547bc0c43dc6992cf17307a3/tests/src/PHPUnit/ClassStructure/ClassStructureTest.php:102

2) Swaggest\JsonSchema\Tests\PHPUnit\ClassStructure\ClassStructureTest::testPatternProperties
Trying to access array offset on value of type null

/dev/shm/BUILDROOT/php-swaggest-json-schema-0.12.27-1.fc31.remi.x86_64/usr/share/php/Swaggest/JsonSchema/Wrapper.php:108
/dev/shm/BUILDROOT/php-swaggest-json-schema-0.12.27-1.fc31.remi.x86_64/usr/share/php/Swaggest/JsonSchema/Structure/ClassStructureTrait.php:161
/dev/shm/BUILD/php-json-schema-9ec863a05a40e9b4547bc0c43dc6992cf17307a3/tests/src/Helper/SampleProperties.php:43
/dev/shm/BUILD/php-json-schema-9ec863a05a40e9b4547bc0c43dc6992cf17307a3/tests/src/PHPUnit/ClassStructure/ClassStructureTest.php:122
codecov[bot] commented 4 years ago

Codecov Report

Merging #101 into master will increase coverage by 0.12%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #101      +/-   ##
==========================================
+ Coverage   92.15%   92.27%   +0.12%     
==========================================
  Files          27       27              
  Lines        1619     1619              
==========================================
+ Hits         1492     1494       +2     
+ Misses        127      125       -2
Impacted Files Coverage Δ
src/Wrapper.php 57.62% <100%> (ø) :arrow_up:
src/MagicMapTrait.php 83.78% <0%> (+5.4%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9ec863a...2d8ed28. Read the comment docs.

vearutop commented 4 years ago

Thank you, tagged as v0.12.28.