dirname() => __DIR__
isset check for Undefined variable client_secret
code warning with unused variable
psr-4 as recommended