code cleanup

<del>The 1st commit can be considered to be a bugfix because the wrong variable was used there, at least with my understanding of the code.</del>

The <del>2nd</del> 1st commit removes unused variables while trying not to break stuff, as the code seems to be pretty fragile. There are still plenty of unused variables when calling methods in the manner of naming arguments like for `self::json_decode($value, $assoc = true)` where `$assoc` is in fact useless. I could remove them all as well.

The <del>3rd</del> 2nd commit fixes the order of keywords in method signatures:
`static (public|protected|private) function` &rarr; `(public|protected|private) static function`.

Let me know what you think.