google-cloud-php icon indicating copy to clipboard operation
google-cloud-php copied to clipboard

Upgrade handwritten libraries with PHP 7.4+ features

Open bshaffer opened this issue 1 year ago • 1 comments

  • [ ] Use null-coalescing operator (??) instead of isset and ternary operators.
    // PHP 5.6
    $var = isset($array['key']) ? $array['key'] : 'default';
    // PHP 7.4
    $var = $array['key'] ?? 'default';
    
  • [ ] Add typed properties
  • [ ] use PHP Arrow Functions
  • [ ] replace calls to call_user_func_array with the spread operator
  • [ ] Add return typehints
  • [ ] Add primitive type hints

bshaffer avatar May 11 '23 18:05 bshaffer

@bshaffer , Should #6049 should mark the first task as complete?

yash30201 avatar Nov 13 '23 23:11 yash30201