Skip to content

Commit 96e813d

Browse files
committed
Refactor PHP linting command for improved output and clarity; streamline nested foreach loop in Data.php for better readability
1 parent 4b517b4 commit 96e813d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.github/workflows/reusable-php-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
- name: Detect coding standard violations (PHPCS)
5050
if: ${{ inputs.run-phpcs }}
51-
run: composer lint -- --report=checkstyle | cs2pr --graceful-warnings
51+
run: composer lint -- -q --report=checkstyle | cs2pr --graceful-warnings
5252

5353
- name: Detect PHPStan issues
5454
if: ${{ inputs.run-phpstan }}

src/Data.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ private function extract_value_from_html( array $attribute, string $html, int $p
211211
case 'query':
212212
if ( isset( $attribute['query'] ) && count( $node ) > 0 ) {
213213
$counter = 0;
214-
foreach ( $node as $v_node ) {
215-
foreach ( $attribute['query'] as $key => $current_attribute ) {
214+
foreach ( $node as $v_node ) {foreach ( $attribute['query'] as $key => $current_attribute ) {
216215
$current_value = $this->get_attribute( $current_attribute, $v_node->html(), $post_id );
217216
if ( null !== $current_value ) {
218217
$value[ $counter ][ $key ] = $current_value;

0 commit comments

Comments
 (0)