Skip to content

Commit d52da35

Browse files
committed
Replace tab indentation with 4 spaces
The repo standard is spaces: .editorconfig sets indent_style = space / indent_size = 4, and phpcs.xml enables Generic.WhiteSpace.DisallowTabIndent plus ScopeIndent with tabIndent=false. Five changed files had slipped through: - facebook-for-wordpress.php carries a // phpcs:ignoreFile, so it is never linted. Also adds the missing blank line after the new $tracking_facade property and drops a whitespace-only line. - __tests__/* is excluded in phpcs.xml, so TrackableLeadFormMappingTest was unchecked. - In Pixel and TrackableIntegrationBase the tabs sat inside the multi-line printf()/sprintf() markup templates rather than in code indentation, so the sniff never saw them; only the emitted whitespace changes. - composer.json had one pre-existing tab on the phpunit require-dev line. No behavior change.
1 parent f7c4a3c commit d52da35

5 files changed

Lines changed: 44 additions & 43 deletions

File tree

__tests__/integration/TrackableLeadFormMappingTest.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,27 @@
2424
*/
2525
final class TrackableLeadFormMappingTest extends FacebookWordpressTestBase {
2626

27-
/**
28-
* When a form field is mapped to a composite Lead parameter (e.g. an
29-
* address), apply_field_mapping() should expand it into its sub-parameters
30-
* (city/state/zip/country) rather than assigning the raw composite value.
31-
*
32-
* This is not implemented yet: apply_field_mapping() currently does a flat
33-
* assignment, and composite targets aren't in VALID_LEAD_PARAMETERS. It is
34-
* blocked on the mapping UI, which will define how composite fields declare
35-
* their sub-field targets. See the TODO(mapping-UI) note in
36-
* TrackableLeadFormIntegrationBase::apply_field_mapping().
37-
*
38-
* Intended assertions once implemented: mapping an 'address' form field
39-
* should yield lead data with 'city', 'state', 'zip', and 'country' keys.
40-
*
41-
* @return void
42-
*/
43-
public function testCompositeAddressMappingIsExpanded() {
44-
$this->markTestIncomplete(
45-
'Composite (address) field mapping breakdown is pending the mapping '
46-
. 'UI. See TrackableLeadFormIntegrationBase::apply_field_mapping '
47-
. 'TODO(mapping-UI).'
48-
);
49-
}
27+
/**
28+
* When a form field is mapped to a composite Lead parameter (e.g. an
29+
* address), apply_field_mapping() should expand it into its sub-parameters
30+
* (city/state/zip/country) rather than assigning the raw composite value.
31+
*
32+
* This is not implemented yet: apply_field_mapping() currently does a flat
33+
* assignment, and composite targets aren't in VALID_LEAD_PARAMETERS. It is
34+
* blocked on the mapping UI, which will define how composite fields declare
35+
* their sub-field targets. See the TODO(mapping-UI) note in
36+
* TrackableLeadFormIntegrationBase::apply_field_mapping().
37+
*
38+
* Intended assertions once implemented: mapping an 'address' form field
39+
* should yield lead data with 'city', 'state', 'zip', and 'country' keys.
40+
*
41+
* @return void
42+
*/
43+
public function testCompositeAddressMappingIsExpanded() {
44+
$this->markTestIncomplete(
45+
'Composite (address) field mapping breakdown is pending the mapping '
46+
. 'UI. See TrackableLeadFormIntegrationBase::apply_field_mapping '
47+
. 'TODO(mapping-UI).'
48+
);
49+
}
5050
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"wp-coding-standards/wpcs": "^3.1",
1010
"symfony/finder": "~2.6",
1111
"mockery/mockery": "^1.6",
12-
"phpunit/phpunit": "~9",
12+
"phpunit/phpunit": "~9",
1313
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
1414
"php-stubs/wordpress-stubs": "^7.0"
1515
},

core/signals/class-pixel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ public function print_out_pending_dom_elements() {
160160
$pixel_dom = $this->generate_script_for_tracked_events( true );
161161
printf(
162162
'
163-
<!-- Meta Pixel Event Code -->
164-
%s
165-
<!-- End Meta Pixel Event Code -->',
163+
<!-- Meta Pixel Event Code -->
164+
%s
165+
<!-- End Meta Pixel Event Code -->',
166166
$pixel_dom // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Pixel DOM is plugin-generated script, not user input.
167167
);
168168
}

facebook-for-wordpress.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
* FacebookForWordpress root class.
6161
*/
6262
class FacebookForWordpress {
63-
private $tracking_facade;
64-
/**
63+
private $tracking_facade;
64+
65+
/**
6566
* Plugin constructor. Initializes the plugin options, loads the translation files,
6667
* sets up the Facebook pixel, sets up the pixel injection, and sets up the settings
6768
* page. Also starts the server event async task.
@@ -77,18 +78,18 @@ public function __construct() {
7778

7879
$options = FacebookWordpressOptions::get_options();
7980

80-
$this->tracking_facade = new FacebookTrackingFacade(
81-
FacebookWordpressOptions::get_agent_string(),
81+
$this->tracking_facade = new FacebookTrackingFacade(
82+
FacebookWordpressOptions::get_agent_string(),
8283
FacebookWordpressOptions::get_active_pixel_id()
83-
);
84-
85-
$this->tracking_facade->initialize();
84+
);
85+
86+
$this->tracking_facade->initialize();
8687
$tracking_facade = $this->tracking_facade;
8788

8889
// Initialize the third-party plugin integrations.
8990
add_action( 'init', function(...$args) use($tracking_facade) {
90-
$this->initialize_integrations( $tracking_facade );
91-
}, 0 );
91+
$this->initialize_integrations( $tracking_facade );
92+
}, 0 );
9293

9394
add_action( 'parse_request', array( $this, 'handle_events_request' ), 0 );
9495

@@ -98,9 +99,9 @@ public function __construct() {
9899
self::update_db_for_wpcom();
99100
}
100101

101-
public function get_tracking_facade() {
102-
return $this->tracking_facade;
103-
}
102+
public function get_tracking_facade() {
103+
return $this->tracking_facade;
104+
}
104105

105106
/**
106107
* Resets the FBL4B upgrade notice dismiss flag when the plugin is updated,

integration/class-trackableintegrationbase.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ protected function register_ajax_container( $listener_js ) {
171171
$this->signals->register_ajax_dom_container(
172172
sprintf(
173173
"<!-- Meta Pixel Event Code -->
174-
<script type='text/javascript'>
175-
%s
176-
</script>
177-
<!-- End Meta Pixel Event Code -->",
174+
<script type='text/javascript'>
175+
%s
176+
</script>
177+
<!-- End Meta Pixel Event Code -->",
178178
$listener_js
179179
)
180180
);

0 commit comments

Comments
 (0)