Skip to content

Commit

Permalink
Merge branch 'dev' into USAGOV-2103-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
omerida authored Jan 13, 2025
2 parents 61d8513 + a8fafaa commit fcce8b3
Show file tree
Hide file tree
Showing 13 changed files with 181 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ jobs:

lint:
docker:
- image: cimg/php:8.1.27-node
- image: cimg/php:8.3-node
steps:
- checkout
- run:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,17 @@ PHPCodesniffer and the parallel linting tools should be installed automatically
The following composer scripts are aliases for running these tools.
* Check for code style errors across all project files. Must have zero errors:
`./bin/composer phpcs-errors`:
* Check for code style errors and warnings across all project files.
`./bin/composer phpcs-strict`
`./bin/composer phpcs-errors`
* Check for code style errors and warnings across all project file
`./bin/composer phpcs-strict`
* Check for code style errors in current branch. Must have zero errors:
`./bin/composer phpcs-changes`
* Check for code style errors and warnings in current branch.
`./bin/composer phpcs-changes-strict`
* Check for PHP lint errors
`./bin/composer php-lint`
* Check for PHP 8.3 compatibility
`./bin/composer php-compatibility`
## Checking code with PHPStan
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@
"drupal/coder": "^8.3",
"mglaman/phpstan-drupal": "*",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "*",
"phpstan/phpstan-deprecation-rules": "*"
"phpstan/phpstan-deprecation-rules": "*",
"rector/rector": "^2.0"
},
"scripts": {
"changed-files": [
Expand All @@ -194,6 +196,9 @@
],
"phpstan": [
"vendor/bin/phpstan --memory-limit=1G"
],
"php-compatibility": [
"vendor/bin/phpcs -pn --runtime-set testVersion 8.3- web/modules/custom web/themes/custom -d memory_limit=2G --standard=.phpcs.xml.dist"
]
}
}
135 changes: 128 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/web/modules/custom/',
__DIR__ . '/web/themes/custom/',
]);

// Other configurations, such as rule sets
$rectorConfig->sets([
SetList::PHP_83,
]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function getFormId(): string {
/**
* {@inheritdoc}
*/
#[\Override]
public function buildForm(array $form, FormStateInterface $form_state): array {
$form['#attached']['library'][] = 'usa_orphaned_entities/orphaned';
$form = parent::buildForm($form, $form_state);
Expand Down Expand Up @@ -94,6 +95,7 @@ public function buildForm(array $form, FormStateInterface $form_state): array {
/**
* {@inheritdoc}
*/
#[\Override]
public function validateForm(array &$form, FormStateInterface $form_state) {
// foreach ($form['#entity_reference'] as $index => $entity_reference) {

Expand All @@ -113,6 +115,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
#[\Override]
public function submitForm(array &$form, FormStateInterface $form_state): void {
$config = $this->config('orphaned_entities.settings');
foreach ($form['#entity_reference'] as $index => $entity_reference) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ class TaxonomyDatalayerBuilder {
public const HOME_TITLE_ES = "Página principal";
public const HOME_URL_ES = "/es/";

private const ABOUT_GOVT_EN = "About the U.S. and its government";
private const ABOUT_URL_EN = "/about-the-us";
private const string ABOUT_GOVT_EN = "About the U.S. and its government";
private const string ABOUT_URL_EN = "/about-the-us";

private const ABOUT_GOVT_ES = "Acerca de EE. UU. y su Gobierno";
private const ABOUT_URL_ES = "/es/acerca-de-estados-unidos";
private const string ABOUT_GOVT_ES = "Acerca de EE. UU. y su Gobierno";
private const string ABOUT_URL_ES = "/es/acerca-de-estados-unidos";

private const AGENCY_INDEX_URL_EN = '/agency-index';
private const AGENCY_INDEX_URL_ES = '/es/indice-agencias';
private const string AGENCY_INDEX_URL_EN = '/agency-index';
private const string AGENCY_INDEX_URL_ES = '/es/indice-agencias';

private const STATE_INDEX_URL_EN = '/state-governments';
private const STATE_INDEX_URL_ES = '/es/gobiernos-estatales';
private const string STATE_INDEX_URL_EN = '/state-governments';
private const string STATE_INDEX_URL_ES = '/es/gobiernos-estatales';

/**
* Language code for entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function getFormId() {
/**
* {@inheritdoc}
*/
#[\Override]
public function buildForm(array $form, FormStateInterface $form_state) {
$form = parent::buildForm($form, $form_state);

Expand All @@ -35,6 +36,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
#[\Override]
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('usagov_benefit_finder.settings')
->set('automate_json_data_file_generating', $form_state->getValue('automate_json_data_file_generating'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
#[\Override]
public function validateForm(array &$form, FormStateInterface $form_state) {
$all_files = $this->getRequest()->files->get('files', []);
$file = $all_files['acronym_file'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
#[\Override]
public function validateForm(array &$form, FormStateInterface $form_state) {
$all_files = $this->getRequest()->files->get('files', []);
$file = $all_files['synonym_file'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
#[\Override]
public function validateForm(array &$form, FormStateInterface $form_state) {
$all_files = $this->getRequest()->files->get('files', []);
$file = $all_files['toggle_map_file'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct(ConfigFactoryInterface $config_factory, StateInterfa
/**
* {@inheritdoc}
*/
#[\Override]
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
Expand All @@ -60,6 +61,7 @@ protected function getEditableConfigNames() {
/**
* {@inheritdoc}
*/
#[\Override]
public function buildForm(array $form, FormStateInterface $form_state) {
$form['sso_login_path'] = [
'#type' => 'textfield',
Expand Down Expand Up @@ -89,6 +91,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
/**
* {@inheritdoc}
*/
#[\Override]
public function submitForm(array &$form, FormStateInterface $form_state) {

$this->state->set('usagov_login_local_form', $form_state->getValue('display_local'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
)]
class SidebarFirstBlock extends AbstractMenuBlock {

private const AGENCIES_NID_EN = 629;
private const AGENCIES_NID_ES = 1696;
private const STATES_NID_EN = 1885;
private const STATES_NID_ES = 1870;
private const int AGENCIES_NID_EN = 629;
private const int AGENCIES_NID_ES = 1696;
private const int STATES_NID_EN = 1885;
private const int STATES_NID_ES = 1870;

/**
* {@inheritdoc}
Expand Down

0 comments on commit fcce8b3

Please sign in to comment.