Fix type hint

PHPStorm wrongly inferred the type 'Unicode'
Fix type hint

In PHPStorm the inferred type was 'A'
Remove unused var
Remove unused local vars
Get rid of naming clash

Static code analysis tool did not like this.
Looks like it was wrong before. Tests unchanged though.
Restore unused var
minor #1465 Some minor cleanup (JeroenDeDauw)

This PR was merged into the 1.16-dev branch.

Discussion
----------

Some minor cleanup

Commits
-------

e6da6bb Restore unused var
d8e1077 Get rid of naming clash
3e50672 Remove unused local vars
291141f Remove unused var
9921554 Fix type hint
1d2b877 Fix type hint