Core/src/ArrayTrait.php
private function pluck($key, array &$arr, $isRequired = true)
    {
        if (!array_key_exists($key, $arr)) {
            if ($isRequired) {
                throw new \InvalidArgumentException(
                    "Key $key does not exist in the provided array."
                );
            }

            return null;
        }

        $value = $arr[$key];
        unset($arr[$key]);
        return $value;
    }
private function pluck($key, array &$arr, $isRequired = true)
    {
        if (!array_key_exists($key, $arr)) {
            if ($isRequired) {
                throw new \InvalidArgumentException(
                    "Key $key does not exist in the provided array."
                );
            }

            return null;
        }

        $value = $arr[$key];
        unset($arr[$key]);
        return $value;
    }
private function pluck ( $ key , array & $ arr , $ isRequired = true ) { if ( ! array_key_exists ( $ key , $ arr ) ) { if ( $ isRequired ) { throw new \ InvalidArgumentException ( "Key $key does not exist in the provided array." ) ; } return null ; } $ value = $ arr [ $ key ] ; unset ( $ arr [ $ key ] ) ; return $ value ; }
Pluck a value out of an array.

@param string $key
@param array $arr
@param bool $isRequired
@return string|null
@throws \InvalidArgumentException
Pluck a value out of an array .