Symfony 5.2 introduces Symfony\Component\HttpFoundation\InputBag to replace Symfony\Component\HttpFoundation\ParameterBag in some cases and the method Symfony\Component\HttpFoundation\InputBag::get() has been deprecated for non-string return values. Therefore, retrieving a non-string return value should use Drupal\Core\Http\InputBag::all() instead. The class Drupal\Core\Http\InputBag will be replaced by the class Symfony\Component\HttpFoundation\InputBag when Symfony 4 is no longer supported by Drupal.
The main different is that ::all() can take a parameter:
Before:
$ajax_page_state = $request->request->get('ajax_page_state', []);
The second parameter is optional and is the default value when the input key (the first parameter) does not exists.
After:
Option #1:
$ajax_page_state = $request->request->all('ajax_page_state');
When the input key does not exists, the method will return an empty array.
When the input key does exists and has a non-array value, then an UnexpectedValueException() will be thrown.
Option #2:
$ajax_page_state = $request->request->all()['ajax_page_state'] ?? NULL;
Calling the method in this way will never result in an UnexpectedValueException() being thrown.
Calling the method in this way, gives the coder the option the set the default value.