@@ 680-704 (lines=25) @@ | ||
677 | * @psalm-suppress PossiblyInvalidArgument |
|
678 | * @psalm-suppress InvalidScalarArgument |
|
679 | */ |
|
680 | if ( |
|
681 | $this->pathSeparator |
|
682 | && |
|
683 | (string) $offset === $offset |
|
684 | && |
|
685 | \strpos($offset, $this->pathSeparator) !== false |
|
686 | ) { |
|
687 | $explodedPath = \explode($this->pathSeparator, (string) $offset); |
|
688 | if ($explodedPath !== false) { |
|
689 | /** @var string $lastOffset - helper for phpstan */ |
|
690 | $lastOffset = \array_pop($explodedPath); |
|
691 | $containerPath = \implode($this->pathSeparator, $explodedPath); |
|
692 | ||
693 | /** |
|
694 | * @psalm-suppress MissingClosureReturnType |
|
695 | * @psalm-suppress MissingClosureParamType |
|
696 | */ |
|
697 | $this->callAtPath( |
|
698 | $containerPath, |
|
699 | static function ($container) use ($lastOffset, &$offsetExists) { |
|
700 | $offsetExists = \array_key_exists($lastOffset, $container); |
|
701 | } |
|
702 | ); |
|
703 | } |
|
704 | } |
|
705 | ||
706 | return $offsetExists; |
|
707 | } |
|
@@ 784-811 (lines=28) @@ | ||
781 | * @psalm-suppress PossiblyInvalidArgument |
|
782 | * @psalm-suppress InvalidScalarArgument |
|
783 | */ |
|
784 | if ( |
|
785 | $this->pathSeparator |
|
786 | && |
|
787 | (string) $offset === $offset |
|
788 | && |
|
789 | \strpos($offset, $this->pathSeparator) !== false |
|
790 | ) { |
|
791 | $path = \explode($this->pathSeparator, (string) $offset); |
|
792 | ||
793 | if ($path !== false) { |
|
794 | $pathToUnset = \array_pop($path); |
|
795 | ||
796 | /** |
|
797 | * @psalm-suppress MissingClosureReturnType |
|
798 | * @psalm-suppress MissingClosureParamType |
|
799 | */ |
|
800 | $this->callAtPath( |
|
801 | \implode($this->pathSeparator, $path), |
|
802 | static function (&$offset) use ($pathToUnset) { |
|
803 | if (\is_array($offset)) { |
|
804 | unset($offset[$pathToUnset]); |
|
805 | } else { |
|
806 | $offset = null; |
|
807 | } |
|
808 | } |
|
809 | ); |
|
810 | } |
|
811 | } |
|
812 | ||
813 | unset($this->array[$offset]); |
|
814 | } |