Skip to content

Commit

Permalink
PROD-7243 Add whitelists and patchers to exclude myclabs due to inter…
Browse files Browse the repository at this point in the history
…face stringable not found issue
  • Loading branch information
bb-yudhisthir committed May 27, 2024
1 parent e4a7a99 commit cc6821b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
27 changes: 20 additions & 7 deletions scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,26 @@

$namespace = 'BuddyBossPlatform';

return [
return array(

// The prefix configuration. If a non null value will be used, a random prefix will be generated.
'prefix' => $namespace,
'whitelist' => [
'prefix' => $namespace,
'whitelist' => array(

// Excludes specific namespaces from being prefixed.
'Composer\\*',
],
'finders' => [],
'patchers' => [],
];
'MyCLabs',
'MyCLabs\\*',
),
'finders' => array(),
'patchers' => array(
function ( $file_path, $prefix, $contents ) {

// Check the file path and possibly return the original contents.
if ( strpos( $file_path, 'myclabs/php-enum' ) !== false ) {
return file_get_contents( $file_path ); // Revert to original contents.
}
return $contents; // Return modified contents for other files.
},
),
);
29 changes: 21 additions & 8 deletions src/scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,26 @@

$namespace = 'BuddyBossPlatform';

return [
return array(

// The prefix configuration. If a non null value will be used, a random prefix will be generated.
'prefix' => $namespace,
'whitelist' => [
'prefix' => $namespace,
'whitelist' => array(

// Excludes specific namespaces from being prefixed.
'Composer\\*'
],
'finders' => [],
'patchers' => [],
];
'Composer\\*',
'MyCLabs',
'MyCLabs\\*',
),
'finders' => array(),
'patchers' => array(
function ( $file_path, $prefix, $contents ) {

// Check the file path and possibly return the original contents.
if ( strpos( $file_path, 'myclabs/php-enum' ) !== false ) {
return file_get_contents( $file_path ); // Revert to original contents.
}
return $contents; // Return modified contents for other files.
},
),
);

0 comments on commit cc6821b

Please sign in to comment.