Unused method, property, variable or parameter 11

  • Minor
  • Deadcode

More information: https://insight.sensiolabs.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. $app['assets.named_packages'] = array();
  2. // prototypes
  3. $app['assets.strategy_factory'] = $app->protect(function ($version, $format, $jsonManifestPath, $name) use ($app) {

    This app use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by MatTheCat
  4. if ($version && $jsonManifestPath) {
  5. throw new \LogicException(sprintf('Asset package "%s" cannot have version and manifest.', $name));
  6. }
  7. if ($version) {
  1. );
  2. };
  3. });
  4. $app['security.user_provider.inmemory._proto'] = $app->protect(function ($params) use ($app) {
  5. return function () use ($app, $params) {

    This app use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. $users = array();
  7. foreach ($params as $name => $user) {
  8. $users[$name] = array('roles' => (array) $user[0], 'password' => $user[1]);
  9. }
  1. return $handler;
  2. };
  3. });
  4. $app['security.authentication.failure_handler._proto'] = $app->protect(function ($name, $options) use ($app) {
  5. return function () use ($name, $options, $app) {

    This name use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new DefaultAuthenticationFailureHandler(
  7. $app,
  8. $app['security.http_utils'],
  9. $options,
  10. $app['logger']
  1. );
  2. };
  3. });
  4. $app['security.authentication_listener.guard._proto'] = $app->protect(function ($providerKey, $options) use ($app, $that) {
  5. return function () use ($app, $providerKey, $options, $that) {

    This that use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Jérôme Tamarelle
  6. if (!isset($app['security.authentication.guard_handler'])) {
  7. $app['security.authentication.guard_handler'] = new GuardAuthenticatorHandler($app['security.token_storage'], $app['dispatcher']);
  8. }
  9. $authenticators = array();
  1. );
  2. };
  3. });
  4. $app['security.authentication_listener.http._proto'] = $app->protect(function ($providerKey, $options) use ($app) {
  5. return function () use ($app, $providerKey, $options) {

    This options use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new BasicAuthenticationListener(
  7. $app['security.token_storage'],
  8. $app['security.authentication_manager'],
  9. $providerKey,
  10. $app['security.entry_point.'.$providerKey.'.http'],
  1. );
  2. };
  3. });
  4. $app['security.authentication_listener.anonymous._proto'] = $app->protect(function ($providerKey, $options) use ($app) {
  5. return function () use ($app, $providerKey, $options) {

    This options use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new AnonymousAuthenticationListener(
  7. $app['security.token_storage'],
  8. $providerKey,
  9. $app['logger']
  10. );
  1. );
  2. };
  3. });
  4. $app['security.authentication.logout_handler._proto'] = $app->protect(function ($name, $options) use ($app) {
  5. return function () use ($name, $options, $app) {

    This name use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new DefaultLogoutSuccessHandler(
  7. $app['security.http_utils'],
  8. isset($options['target_url']) ? $options['target_url'] : '/'
  9. );
  10. };
  1. return $listener;
  2. };
  3. });
  4. $app['security.authentication_listener.switch_user._proto'] = $app->protect(function ($name, $options) use ($app, $that) {
  5. return function () use ($app, $name, $options, $that) {

    This that use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new SwitchUserListener(
  7. $app['security.token_storage'],
  8. $app['security.user_provider.'.$name],
  9. $app['security.user_checker'],
  10. $name,
  1. return new FormAuthenticationEntryPoint($app, $app['security.http_utils'], $loginPath, $useForward);
  2. };
  3. });
  4. $app['security.entry_point.http._proto'] = $app->protect(function ($name, array $options) use ($app) {
  5. return function () use ($app, $name, $options) {

    This name use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new BasicAuthenticationEntryPoint(isset($options['real_name']) ? $options['real_name'] : 'Secured');
  7. };
  8. });
  9. $app['security.entry_point.guard._proto'] = $app->protect(function ($name, array $options) use ($app) {
  1. return new FormAuthenticationEntryPoint($app, $app['security.http_utils'], $loginPath, $useForward);
  2. };
  3. });
  4. $app['security.entry_point.http._proto'] = $app->protect(function ($name, array $options) use ($app) {
  5. return function () use ($app, $name, $options) {

    This app use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new BasicAuthenticationEntryPoint(isset($options['real_name']) ? $options['real_name'] : 'Secured');
  7. };
  8. });
  9. $app['security.entry_point.guard._proto'] = $app->protect(function ($name, array $options) use ($app) {
  1. );
  2. };
  3. });
  4. $app['security.authentication_provider.anonymous._proto'] = $app->protect(function ($name, $options) use ($app) {
  5. return function () use ($app, $name) {

    This app use argument is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Fabien Potencier
  6. return new AnonymousAuthenticationProvider($name);
  7. };
  8. });
  9. if (isset($app['validator'])) {