Skip to content

Commit

Permalink
refactor!: VOL-4762 olcs-internal now PHP 8 compatible (dvsa/olcs-int…
Browse files Browse the repository at this point in the history
…ernal#156)

* refactor!: require php 8, bump dependencies to php8 compatible versions

* refactor: remove incorrect return types for Laminas ConsoleModel

* refactor!: run rector PHP 8.0 ruleset

* refactor: fix tests to work with extra type checking from updated dependencies

* chore: update CI to use PHP 8.0

* fix: skip ConversationTest for now, refactor ticket raised VOL-5357

* refactor: fix phpcs
  • Loading branch information
ilindsay authored May 2, 2024
1 parent 05aa8a2 commit d939910
Show file tree
Hide file tree
Showing 283 changed files with 1,340 additions and 2,718 deletions.
4 changes: 2 additions & 2 deletions app/internal/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
static-analysis:
uses: dvsa/.github/.github/workflows/php-static.yml@main
with:
php-version: '7.4'
php-version: '8.0'

tests:
uses: dvsa/.github/.github/workflows/php-tests.yml@main
with:
php-versions: "[\"7.4\"]"
php-versions: "[\"8.0\"]"
fail-fast: false
9 changes: 4 additions & 5 deletions app/internal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"url": "https://github.com/dvsa/laminas-form.git"
}],
"require": {
"php": "^7.4",
"php": "~8.0.0",
"ext-redis": "*",
"dvsa/laminas-config-cloud-parameters": "^0.2.0",
"laminas/laminas-authentication": "^2.5",
Expand All @@ -22,7 +22,6 @@
"laminas/laminas-inputfilter": "^2.5",
"laminas/laminas-json": "^3.0",
"laminas/laminas-mvc": "^3.0",
"laminas/laminas-mvc-console": "^1.3",
"laminas/laminas-mvc-i18n": "^1",
"laminas/laminas-mvc-plugin-flashmessenger": "^1",
"laminas/laminas-mvc-plugin-prg": "^1",
Expand All @@ -34,10 +33,10 @@
"laminas/laminas-view": "^2.5",
"lm-commons/lmc-rbac-mvc": "^3.0",
"firebase/php-jwt": "^6.0",
"olcs/olcs-auth": "^7.0",
"olcs/olcs-common": "^6.0.0",
"olcs/olcs-auth": "^8.0",
"olcs/olcs-common": "^7.0.0",
"olcs/olcs-logging": "^7.2",
"olcs/olcs-transfer": "^6.0.0",
"olcs/olcs-transfer": "^7.0.0",
"olcs/olcs-utils": "^6.0.0",
"saeven/zf3-purifier": "^1.1",
"doctrine/doctrine-module": "^5",
Expand Down
1,742 changes: 745 additions & 997 deletions app/internal/composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ abstract class AbstractController extends LaminasAbstractActionController implem
{
use GenericRenderView;

protected Placeholder $placeholder;

public function __construct(
Placeholder $placeholder
) {
$this->placeholder = $placeholder;
public function __construct(protected Placeholder $placeholder)
{
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,13 @@ class CompaniesHouseAlertController extends AbstractInternalController implement
]
];

protected HelperPluginManager $viewHelperPluginManager;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
HelperPluginManager $viewHelperPluginManager
protected HelperPluginManager $viewHelperPluginManager
) {
$this->viewHelperPluginManager = $viewHelperPluginManager;
parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,19 @@ class ContinuationChecklistReminderController extends AbstractController
use CrudActionTrait;

public const TYPE_CONT_CHECKLIST_REMINDER_GENERATE_LETTER = 'que_typ_cont_check_rem_gen_let';

protected DateHelperService $dateHelper;
protected FlashMessengerHelperService $flashMessengerHelper;
protected ScriptFactory $scriptFactory;
protected FormHelperService $formHelper;
protected ResponseHelperService $responseHelper;
protected TableFactory $tableFactory;

public function __construct(
Placeholder $placeholder,
DateHelperService $dateHelper,
protected DateHelperService $dateHelper,
FlashMessengerHelperService $flashMessengerHelper,
ScriptFactory $scriptFactory,
FormHelperService $formHelper,
ResponseHelperService $responseHelper,
TableFactory $tableFactory
protected ScriptFactory $scriptFactory,
protected FormHelperService $formHelper,
protected ResponseHelperService $responseHelper,
protected TableFactory $tableFactory
) {
parent::__construct($placeholder);
$this->dateHelper = $dateHelper;
$this->flashMessengerHelper = $flashMessengerHelper;
$this->scriptFactory = $scriptFactory;
$this->formHelper = $formHelper;
$this->responseHelper = $responseHelper;
$this->tableFactory = $tableFactory;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,17 @@ class ContinuationController extends AbstractController
protected $detailRoute = 'admin-dashboard/admin-continuation/detail';

protected FlashMessengerHelperService $flashMessengerHelper;
protected ScriptFactory $scriptFactory;
protected TranslationHelperService $translationHelper;
protected TableFactory $tableFactory;
protected FormHelperService $formHelper;

public function __construct(
Placeholder $placeholder,
FlashMessengerHelperService $flashMessengerHelper,
ScriptFactory $scriptFactory,
TranslationHelperService $translationHelper,
TableFactory $tableFactory,
FormHelperService $formHelper
protected ScriptFactory $scriptFactory,
protected TranslationHelperService $translationHelper,
protected TableFactory $tableFactory,
protected FormHelperService $formHelper
) {
parent::__construct($placeholder);
$this->flashMessengerHelper = $flashMessengerHelper;
$this->scriptFactory = $scriptFactory;
$this->translationHelper = $translationHelper;
$this->tableFactory = $tableFactory;
$this->formHelper = $formHelper;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@
class ExportController extends AbstractInternalController implements LeftViewProvider
{
protected $navigationId = 'admin-dashboard/admin-data-retention';
protected TableFactory $tableFactory;
protected ResponseHelperService $responseHelperService;

public function __construct(
TranslationHelperService $translationHelper,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
TableFactory $tableFactory,
ResponseHelperService $responseHelperService
protected TableFactory $tableFactory,
protected ResponseHelperService $responseHelperService
) {
$this->tableFactory = $tableFactory;
$this->responseHelperService = $responseHelperService;
parent::__construct($translationHelper, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,16 @@ class DiscPrintingController extends LaminasAbstractActionController implements
protected ScriptFactory $scriptFactory;
protected TableFactory $tableFactory;
protected FormHelperService $formHelper;
protected FlashMessengerHelperService $flashMessengerHelper;

public function __construct(
ScriptFactory $scriptFactory,
TableFactory $tableFactory,
FlashMessengerHelperService $flashMessengerHelper,
protected FlashMessengerHelperService $flashMessengerHelper,
FormHelperService $formHelper
) {
$this->scriptFactory = $scriptFactory;
$this->tableFactory = $tableFactory;
$this->formHelper = $formHelper;
$this->flashMessengerHelper = $flashMessengerHelper;
}

/**
Expand Down Expand Up @@ -109,7 +107,6 @@ public function indexAction()
/**
* Process form
*
* @param array $data
*
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,14 @@ class DocumentTemplateController extends AbstractInternalController implements L
'editAction' => ['forms/document-template']
];

protected Scan $scannerAntiVirusService;
protected SubCategory $subCategoryDataService;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
Scan $scannerAntiVirusService,
SubCategory $subCategoryDataService
protected Scan $scannerAntiVirusService,
protected SubCategory $subCategoryDataService
) {
$this->scannerAntiVirusService = $scannerAntiVirusService;
$this->subCategoryDataService = $subCategoryDataService;

parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ class InterimRefundsController extends AbstractInternalController implements Lef
protected $listDto = ListDto::class;
protected $filterForm = FilterForm::class;

protected DateHelperService $dateHelper;

public function __construct(
TranslationHelperService $translationHelper,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessenger,
Navigation $navigation,
DateHelperService $dateHelper
protected DateHelperService $dateHelper
) {
parent::__construct($translationHelper, $formHelper, $flashMessenger, $navigation);
$this->dateHelper = $dateHelper;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,15 @@ class IrfoStockControlController extends AbstractInternalController implements L
protected $createCommand = CreateDto::class;

protected $addContentTitle = 'Add IRFO Stock Control';
protected DateHelperService $dateHelperService;
protected IrfoCountry $irfoCountryDataService;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
DateHelperService $dateHelperService,
IrfoCountry $irfoCountryDataService
protected DateHelperService $dateHelperService,
protected IrfoCountry $irfoCountryDataService
) {
$this->dateHelperService = $dateHelperService;
$this->irfoCountryDataService = $irfoCountryDataService;
parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
public function getLeftView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ class IrhpPermitJurisdictionController extends AbstractIrhpPermitAdminController

protected $defaultData = ['stockId' => 'route'];

protected ScriptFactory $scriptFactory;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
ScriptFactory $scriptFactory
protected ScriptFactory $scriptFactory
) {
$this->scriptFactory = $scriptFactory;
parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function postScoringReportAction()

$commaSeparatedRows = [];
foreach ($result['rows'] as $row) {
$commaSeparatedRows[] = implode($row);
$commaSeparatedRows[] = implode('', $row);
}

$content = implode("\n", $commaSeparatedRows);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ class IrhpPermitSectorController extends AbstractIrhpPermitAdminController imple

protected $defaultData = ['stockId' => 'route'];

protected ScriptFactory $scriptFactory;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
ScriptFactory $scriptFactory
protected ScriptFactory $scriptFactory
) {
$this->scriptFactory = $scriptFactory;
parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,13 @@ class IrhpPermitStockController extends AbstractInternalController implements Le

protected $tableViewTemplate = 'pages/irhp-permit-stock/index';

private ScriptFactory $scriptFactory;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
ScriptFactory $scriptFactory
private ScriptFactory $scriptFactory
) {
$this->scriptFactory = $scriptFactory;
parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ class PiReportController extends AbstractInternalController implements LeftViewP
protected $listDto = ListDto::class;
protected $filterForm = FilterForm::class;

private DateHelperService $dateHelperService;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
DateHelperService $dateHelperService
private DateHelperService $dateHelperService
) {
$this->dateHelperService = $dateHelperService;
parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@ class PublicationController extends AbstractInternalController implements LeftVi
'publish' => ['requireRows' => true],
];

protected WebDavJsonWebTokenGenerationService $webDavJsonWebTokenGenerationService;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
WebDavJsonWebTokenGenerationService $webDavJsonWebTokenGenerationService
protected WebDavJsonWebTokenGenerationService $webDavJsonWebTokenGenerationService
) {
$this->webDavJsonWebTokenGenerationService = $webDavJsonWebTokenGenerationService;

parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,16 @@ class ReportController extends LaminasAbstractActionController implements LeftVi
protected ScriptFactory $scriptFactory;
protected TableFactory $tableFactory;
protected FormHelperService $formHelper;
protected Placeholder $placeholder;

public function __construct(
ScriptFactory $scriptFactory,
TableFactory $tableFactory,
FormHelperService $formHelper,
Placeholder $placeholder
protected Placeholder $placeholder
) {
$this->scriptFactory = $scriptFactory;
$this->tableFactory = $tableFactory;
$this->formHelper = $formHelper;
$this->placeholder = $placeholder;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,13 @@ class ReportUploadController extends AbstractInternalController implements LeftV
'indexAction' => ['forms/report-upload'],
];

protected Scan $scannerAntiVirusService;

public function __construct(
TranslationHelperService $translationHelperService,
FormHelperService $formHelper,
FlashMessengerHelperService $flashMessengerHelperService,
Navigation $navigation,
Scan $scannerAntiVirusService
protected Scan $scannerAntiVirusService
) {
$this->scannerAntiVirusService = $scannerAntiVirusService;

parent::__construct($translationHelperService, $formHelper, $flashMessengerHelperService, $navigation);
}
/**
Expand Down
Loading

0 comments on commit d939910

Please sign in to comment.