Skip to content

Commit

Permalink
Merge branch 'feature/os2form-audit' of https://github.com/itk-dev/os…
Browse files Browse the repository at this point in the history
…2web_datalookup into feature/os2form-audit
  • Loading branch information
cableman committed May 14, 2024
2 parents b3f18b9 + baf72a3 commit 147141e
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
"drupal/coder": "^8.3",
"mglaman/phpstan-drupal": "^1.1",
"phpstan/extension-installer": "^1.3",
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="PHP_CodeSniffer">
<description>OS2web Audit PHP Code Sniffer configuration</description>
<description>OS2web Datalookup PHP Code Sniffer configuration</description>

<file>.</file>
<exclude-pattern>vendor/</exclude-pattern>
Expand Down
2 changes: 1 addition & 1 deletion src/Form/DataLookupPluginSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(ConfigFactoryInterface $config_factory, PluginManage
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container):static {
public static function create(ContainerInterface $container): static {
return new static(
$container->get('config.factory'),
$container->get('plugin.manager.os2web_datalookup')
Expand Down
2 changes: 1 addition & 1 deletion src/LookupResult/CompanyLookupResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function getHouseNr(): string {
}

/**
* Set hous number.
* Set house number.
*
* @param string $houseNr
* The number.
Expand Down
4 changes: 2 additions & 2 deletions src/LookupResult/CprLookupResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ public function isDigitalPostSubscribed(): bool {
}

/**
* Check is citizen is alive.
* Check if citizen is alive.
*
* @return bool
* The living state.
Expand Down Expand Up @@ -623,7 +623,7 @@ public function setBirthDate(\DateTime $birthDate): void {
* Cpr number.
*
* @return bool
* TRUE if a person has provided CPR as guardian, FALSE otherwise.
* TRUE if the person has provided CPR as guardian, FALSE otherwise.
*/
public function hasGuardian(string $cpr): bool {
foreach ($this->guardians as $guardian) {
Expand Down
5 changes: 4 additions & 1 deletion src/Plugin/os2web/DataLookup/DatafordelerCVR.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ public function lookup(string $param): CompanyLookupResult {
$cvrResult->setFloor($address->CVRAdresse_etagebetegnelse ?? '');
$cvrResult->setApartmentNr($address->CVRAdresse_doerbetegnelse ?? '');
$cvrResult->setPostalCode($address->CVRAdresse_postnummer ?? '');
$city = ($address->CVRAdresse_postdistrikt ?? '') . $cvrResult->getPostalCode() ?? '';
$city = implode(' ', array_filter([
$address->CVRAdresse_postdistrikt ?? NULL,
$cvrResult->getPostalCode() ?? NULL,
]);
$cvrResult->setCity($city);
$cvrResult->setMunicipalityCode($address->CVRAdresse_kommunekode ?? '');

Expand Down
5 changes: 4 additions & 1 deletion src/Plugin/os2web/DataLookup/DatafordelerPNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ public function lookup(string $param): CompanyLookupResult {
$cvrResult->setFloor($address->CVRAdresse_etagebetegnelse ?? '');
$cvrResult->setApartmentNr($address->CVRAdresse_doerbetegnelse ?? '');
$cvrResult->setPostalCode($address->CVRAdresse_postnummer ?? '');
$city = ($address->CVRAdresse_postdistrikt ?? '') . $cvrResult->getPostalCode() ?? '';
$city = implode(' ', array_filter([
$address->CVRAdresse_postdistrikt ?? NULL,
$cvrResult->getPostalCode() ?? NULL,
]);
$cvrResult->setCity($city);
$cvrResult->setMunicipalityCode($address->CVRAdresse_kommunekode ?? '');
$address = $cvrResult->getStreet() . ' ' . $cvrResult->getHouseNr() . ' ' . $cvrResult->getFloor() . $cvrResult->getApartmentNr();
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/os2web/DataLookup/ServiceplatformenCPR.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
'#default_value' => $this->configuration['test_mode_fixed_cpr'],
'#description' => $this->t('Fixed CPR that will be used for all requests to the serviceplatformen instead of the provided CPR.'),
'#states' => [
// Hide the settings when the "cancel notifies" checkbox is disabled.
// Show the element only when running in test mode.
'visible' => [
'input[name="mode_selector"]' => ['value' => 1],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
'#default_value' => $this->configuration['test_mode_fixed_cpr'],
'#description' => $this->t('Fixed CPR that will be used for all requests to the serviceplatformen instead of the provided CPR.'),
'#states' => [
// Hide the settings when the cancel notifies checkbox is disabled.
// Show the element only when running in test mode.
'visible' => [
'input[name="mode_selector"]' => ['value' => 1],
],
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/DataLookupRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function routes(): array {
$routes["os2web_datalookup.groups.$group"] = new Route(
"/admin/config/system/os2web-datalookup/" . str_replace('_', '-', $group),
[
'_form' => '\Drupal\os2web_datalookup\Form\DataLookupPluginGroupSettingsForm',
'_form' => DataLookupPluginGroupSettingsForm::class,
'_title' => $this->t("Configure group :label", [':label' => $group])->__toString(),
'_group_id' => $group,
],
Expand Down

0 comments on commit 147141e

Please sign in to comment.