|
if (isset($params[ConnectionOptions::OPTION_REPLACE_POLICY]) && |
|
$params[ConnectionOptions::OPTION_REPLACE_POLICY] === UpdatePolicy::ERROR |
|
) { |
|
if (null !== $options['revision']) { |
|
$params['ignoreRevs'] = false; |
|
$headers['if-match'] = '"' . $options['revision'] . '"'; |
|
} |
|
} |
Line 651 may cause "Undefined index" Notice
'revision' option may not be set in $options param of put. Docs of replace and replaceById methods doesn't mention it should be provided. Instead it points out to Document's _rev.
So please consider (accordingly to patch method), to base the condition on something like:
$revision = $document->getRevision();
if (null !== $revision) { ...
or provide 'revision' option/param within replace or replaceById methods (ie. like it's done in remove)
The issue doesn't appears in < 3.5.0 , since in previous versions includeOptionsInParams in ArangoDBClient/Handler returns empty array when its $options param is empty.
Condition result:
if (isset($params[ConnectionOptions::OPTION_REPLACE_POLICY]) &&
$params[ConnectionOptions::OPTION_REPLACE_POLICY] === UpdatePolicy::ERROR
)
is always false then
arangodb-php/lib/ArangoDBClient/DocumentHandler.php
Lines 648 to 655 in 54f7800
Line 651 may cause "Undefined index" Notice
'revision'option may not be set in$optionsparam ofput. Docs ofreplaceandreplaceByIdmethods doesn't mention it should be provided. Instead it points out to Document's _rev.So please consider (accordingly to
patchmethod), to base the condition on something like:or provide
'revision'option/param withinreplaceorreplaceByIdmethods (ie. like it's done inremove)The issue doesn't appears in < 3.5.0 , since in previous versions
includeOptionsInParamsinArangoDBClient/Handlerreturns empty array when its$optionsparam is empty.Condition result:
is always false then