Skip to content

Commit 3ce7adf

Browse files
authored
Merge pull request #6 from Falseclock/master
parent detach fix
2 parents ed05560 + 4b7a8ff commit 3ce7adf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/ASN1/ASN1Object.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,17 @@ final public static function fromFile($fileContent)
353353
return self::fromBinary($file);
354354
}
355355

356+
/**
357+
* In case we have to provide object as as, but won't provide access to parent node.
358+
* That's very important in CMS package, cause we do not wont to give an
359+
* ability to change any part of ASN.1 structure.
360+
*
361+
* @return ASN1ObjectInterface
362+
*/
356363
public function detach()
357364
{
358-
$object = clone $this;
359-
$this->parent = null;
365+
$object = clone $this;
366+
$object->parent = null;
360367

361368
return $object;
362369
}

0 commit comments

Comments
 (0)