@@ 673-697 (lines=25) @@ | ||
670 | * @psalm-suppress PossiblyInvalidArgument |
|
671 | * @psalm-suppress InvalidScalarArgument |
|
672 | */ |
|
673 | if ( |
|
674 | $this->pathSeparator |
|
675 | && |
|
676 | (string) $offset === $offset |
|
677 | && |
|
678 | \strpos($offset, $this->pathSeparator) !== false |
|
679 | ) { |
|
680 | $explodedPath = \explode($this->pathSeparator, (string) $offset); |
|
681 | if ($explodedPath !== false) { |
|
682 | /** @var string $lastOffset - helper for phpstan */ |
|
683 | $lastOffset = \array_pop($explodedPath); |
|
684 | $containerPath = \implode($this->pathSeparator, $explodedPath); |
|
685 | ||
686 | /** |
|
687 | * @psalm-suppress MissingClosureReturnType |
|
688 | * @psalm-suppress MissingClosureParamType |
|
689 | */ |
|
690 | $this->callAtPath( |
|
691 | $containerPath, |
|
692 | static function ($container) use ($lastOffset, &$offsetExists) { |
|
693 | $offsetExists = \array_key_exists($lastOffset, $container); |
|
694 | } |
|
695 | ); |
|
696 | } |
|
697 | } |
|
698 | ||
699 | return $offsetExists; |
|
700 | } |
|
@@ 777-804 (lines=28) @@ | ||
774 | * @psalm-suppress PossiblyInvalidArgument |
|
775 | * @psalm-suppress InvalidScalarArgument |
|
776 | */ |
|
777 | if ( |
|
778 | $this->pathSeparator |
|
779 | && |
|
780 | (string) $offset === $offset |
|
781 | && |
|
782 | \strpos($offset, $this->pathSeparator) !== false |
|
783 | ) { |
|
784 | $path = \explode($this->pathSeparator, (string) $offset); |
|
785 | ||
786 | if ($path !== false) { |
|
787 | $pathToUnset = \array_pop($path); |
|
788 | ||
789 | /** |
|
790 | * @psalm-suppress MissingClosureReturnType |
|
791 | * @psalm-suppress MissingClosureParamType |
|
792 | */ |
|
793 | $this->callAtPath( |
|
794 | \implode($this->pathSeparator, $path), |
|
795 | static function (&$offset) use ($pathToUnset) { |
|
796 | if (\is_array($offset)) { |
|
797 | unset($offset[$pathToUnset]); |
|
798 | } else { |
|
799 | $offset = null; |
|
800 | } |
|
801 | } |
|
802 | ); |
|
803 | } |
|
804 | } |
|
805 | ||
806 | unset($this->array[$offset]); |
|
807 | } |