Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Trying to access array offset on value of type null in 7.4 #1187

Merged
merged 2 commits into from
Sep 11, 2019

Conversation

remicollet
Copy link
Contributor

Fix for

4) Sabre\DAVACL\Xml\Property\PrincipalTest::testSimple
Trying to access array offset on value of type null

/work/GIT/sabre-dav/lib/DAV/Xml/Property/Href.php:62
/work/GIT/sabre-dav/tests/Sabre/DAVACL/Xml/Property/PrincipalTest.php:17

After this fix, still some other error in used library


There were 3 errors:

1) Sabre\HTTP\Auth\DigestTest::testInvalidDigest2
Trying to access array offset on value of type bool

/work/GIT/sabre-dav/vendor/sabre/http/lib/Auth/Digest.php:130
/work/GIT/sabre-dav/vendor/sabre/http/lib/Auth/Digest.php:98
/work/GIT/sabre-dav/vendor/sabre/http/tests/HTTP/Auth/DigestTest.php:101

2) Sabre\VObject\Parser\MimeDirTest::testParseError
fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor

/work/GIT/sabre-dav/vendor/sabre/vobject/lib/Parser/MimeDir.php:278
/work/GIT/sabre-dav/vendor/sabre/vobject/lib/Parser/MimeDir.php:144
/work/GIT/sabre-dav/vendor/sabre/vobject/lib/Parser/MimeDir.php:90
/work/GIT/sabre-dav/vendor/sabre/vobject/tests/VObject/Parser/MimeDirTest.php:19

3) Sabre\DAV\Auth\Backend\AbstractDigestTest::testCheckNoHeaders
Trying to access array offset on value of type bool

/work/GIT/sabre-dav/vendor/sabre/http/lib/Auth/Digest.php:121
/work/GIT/sabre-dav/lib/DAV/Auth/Backend/AbstractDigest.php:106
/work/GIT/sabre-dav/tests/Sabre/DAV/Auth/Backend/AbstractDigestTest.php:18

@codecov
Copy link

codecov bot commented Aug 20, 2019

Codecov Report

Merging #1187 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1187   +/-   ##
=========================================
  Coverage     97.17%   97.17%           
  Complexity     2872     2872           
=========================================
  Files           174      174           
  Lines          8067     8067           
=========================================
  Hits           7839     7839           
  Misses          228      228
Impacted Files Coverage Δ Complexity Δ
lib/DAV/Xml/Property/Href.php 100% <100%> (ø) 12 <0> (ø) ⬇️

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 1f6fdea...2a7da39. Read the comment docs.

@@ -59,7 +59,7 @@ public function __construct($hrefs)
*/
public function getHref()
{
return $this->hrefs[0];
return $this->hrefs[0] ?? null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Maybe this function can also get a typehint or just a docblock update

@staabm
Copy link
Member

staabm commented Sep 11, 2019

thx remi, merging..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants