Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for several problems pointed by larastan level 0 #3776

Closed
wants to merge 2 commits into from

Conversation

diegosouza
Copy link
Contributor

Fix for almost all level 0 bugs pointed in #3751

The remaining bug was fixed in #3775

The complete list:

$ php artisan code:analyse -l 0
 311/311 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------------------------------------------------
  Line   app/Console/Commands/InstallCommand.php
 ------ -------------------------------------------------------------------------------------------------------
  178    Result of method CachetHQ\Cachet\Console\Commands\InstallCommand::configureDatabase() (void) is used.
  250    Result of method CachetHQ\Cachet\Console\Commands\InstallCommand::configureDrivers() (void) is used.
  308    Result of method CachetHQ\Cachet\Console\Commands\InstallCommand::configureMail() (void) is used.
 ------ -------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------
  Line   app/Http/Controllers/Api/ComponentController.php
 ------ --------------------------------------------------
  76     Result of function execute (void) is used.
 ------ --------------------------------------------------

 ------ -------------------------------------------------------
  Line   app/Http/Controllers/Api/ComponentGroupController.php
 ------ -------------------------------------------------------
  95     Result of function execute (void) is used.
  118    Result of function execute (void) is used.
 ------ -------------------------------------------------------

 ------ -------------------------------------------------
  Line   app/Http/Controllers/Api/IncidentController.php
 ------ -------------------------------------------------
  70     Result of function execute (void) is used.
  101    Result of function execute (void) is used.
 ------ -------------------------------------------------

 ------ -------------------------------------------------------
  Line   app/Http/Controllers/Api/IncidentUpdateController.php
 ------ -------------------------------------------------------
  77     Result of function execute (void) is used.
  103    Result of function execute (void) is used.
 ------ -------------------------------------------------------

 ------ -----------------------------------------------
  Line   app/Http/Controllers/Api/MetricController.php
 ------ -----------------------------------------------
  65     Result of function execute (void) is used.
  95     Result of function execute (void) is used.
 ------ -----------------------------------------------

 ------ ----------------------------------------------------
  Line   app/Http/Controllers/Api/MetricPointController.php
 ------ ----------------------------------------------------
  51     Result of function execute (void) is used.
  73     Result of function execute (void) is used.
 ------ ----------------------------------------------------

 ------ -------------------------------------------------
  Line   app/Http/Controllers/Api/ScheduleController.php
 ------ -------------------------------------------------
  70     Result of function execute (void) is used.
  96     Result of function execute (void) is used.
 ------ -------------------------------------------------

 ------ ---------------------------------------------------
  Line   app/Http/Controllers/Api/SubscriberController.php
 ------ ---------------------------------------------------
  53     Result of function execute (void) is used.
 ------ ---------------------------------------------------

 ------ --------------------------------------------------------
  Line   app/Http/Controllers/Dashboard/ComponentController.php
 ------ --------------------------------------------------------
  114    Result of function execute (void) is used.
  160    Result of function execute (void) is used.
 ------ --------------------------------------------------------

 ------ -------------------------------------------------------------
  Line   app/Http/Controllers/Dashboard/ComponentGroupController.php
 ------ -------------------------------------------------------------
  129    Result of function execute (void) is used.
  156    Result of function execute (void) is used.
 ------ -------------------------------------------------------------

 ------ ----------------------------------------------------------------------------------------------------------------
  Line   app/Http/Controllers/Dashboard/DashboardController.php                                                         
 ------ ----------------------------------------------------------------------------------------------------------------
  75     Access to an undefined property CachetHQ\Cachet\Http\Controllers\Dashboard\DashboardController::$dateTimeZone. 
  137    Access to an undefined property CachetHQ\Cachet\Http\Controllers\Dashboard\DashboardController::$dateTimeZone. 
  142    Access to an undefined property CachetHQ\Cachet\Http\Controllers\Dashboard\DashboardController::$dateTimeZone. 
  169    Access to an undefined property CachetHQ\Cachet\Http\Controllers\Dashboard\DashboardController::$dateTimeZone. 
  174    Access to an undefined property CachetHQ\Cachet\Http\Controllers\Dashboard\DashboardController::$dateTimeZone. 
 ------ ----------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------
  Line   app/Http/Controllers/Dashboard/IncidentController.php
 ------ -------------------------------------------------------
  120    Result of function execute (void) is used.
  250    Result of function execute (void) is used.
 ------ -------------------------------------------------------

 ------ -------------------------------------------------------------
  Line   app/Http/Controllers/Dashboard/IncidentUpdateController.php
 ------ -------------------------------------------------------------
  104    Result of function execute (void) is used.
  154    Result of function execute (void) is used.
 ------ -------------------------------------------------------------

 ------ -------------------------------------------------------
  Line   app/Http/Controllers/Dashboard/ScheduleController.php
 ------ -------------------------------------------------------
  141    Result of function execute (void) is used.
 ------ -------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------
  Line   app/Http/Controllers/SetupController.php
 ------ -------------------------------------------------------------------------------------------
  143    Access to an undefined property CachetHQ\Cachet\Http\Controllers\SetupController::$langs.
 ------ -------------------------------------------------------------------------------------------

 ------ ----------------------------------------------
  Line   app/Http/Controllers/SubscribeController.php
 ------ ----------------------------------------------
  84     Result of function execute (void) is used.
 ------ ----------------------------------------------

 ------ ------------------------------------------------------------------------------------------------
  Line   app/Http/Middleware/RemoteUserAuthenticate.php
 ------ ------------------------------------------------------------------------------------------------
  30     Access to an undefined property CachetHQ\Cachet\Http\Middleware\RemoteUserAuthenticate::$auth.
  46     Access to an undefined property CachetHQ\Cachet\Http\Middleware\RemoteUserAuthenticate::$auth.
  47     Access to an undefined property CachetHQ\Cachet\Http\Middleware\RemoteUserAuthenticate::$auth.
 ------ ------------------------------------------------------------------------------------------------

 ------ ---------------------------------------------------------------------------------------------------
  Line   app/Http/Middleware/TrustProxies.php
 ------ ---------------------------------------------------------------------------------------------------
  44     CachetHQ\Cachet\Http\Middleware\TrustProxies::__construct() does not call parent constructor from
         Fideloper\Proxy\TrustProxies.
 ------ ---------------------------------------------------------------------------------------------------

 ------ -----------------------------------
  Line   app/Models/Subscription.php
 ------ -----------------------------------
  111    Undefined variable: $component_id
 ------ -----------------------------------

 ------ --------------------------------------------------------
  Line   app/Notifications/Incident/NewIncidentNotification.php
 ------ --------------------------------------------------------
  130    Anonymous function has an unused use $notifiable.
 ------ --------------------------------------------------------

 ------ ------------------------------------------------------------------
  Line   app/Notifications/IncidentUpdate/IncidentUpdatedNotification.php
 ------ ------------------------------------------------------------------
  137    Anonymous function has an unused use $content.
 ------ ------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------
  Line   app/Presenters/IncidentPresenter.php
 ------ ------------------------------------------------------------------------------------------------------
  60     Constructor of class CachetHQ\Cachet\Presenters\IncidentPresenter has an unused parameter $resource.
 ------ ------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------
  Line   app/Presenters/SchedulePresenter.php
 ------ ------------------------------------------------------------------------------------------------------
  45     Constructor of class CachetHQ\Cachet\Presenters\SchedulePresenter has an unused parameter $resource.
 ------ ------------------------------------------------------------------------------------------------------


 [ERROR] Found 42 errors

@diegosouza diegosouza changed the title fix for several errors pointed by larastan level 0 fix for several problems pointed by larastan level 0 Sep 8, 2019
@szepeviktor
Copy link
Contributor

Very nice work. I see you know the codebase.

@diegosouza
Copy link
Contributor Author

Very nice work. I see you know the codebase.

Not really. It was just some PHP/Laravel/software development knowledge and experience.

@szepeviktor
Copy link
Contributor

szepeviktor commented Nov 11, 2019

@jbrooksuk Could it be that robustness may not be on the priority list of this project?

@diegosouza diegosouza closed this Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants