From 3042ee19a3e50e79421141badb25955037083eed Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Thu, 17 Aug 2023 20:03:20 -0500 Subject: [PATCH] Update formatting of scoper.inc.php --- scoper.inc.php | 160 ++++++++++++++++++++++++------------------------- 1 file changed, 77 insertions(+), 83 deletions(-) diff --git a/scoper.inc.php b/scoper.inc.php index c17d5ba..8b7f44d 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -1,4 +1,13 @@ 'WpToTwitter_Vendor', +return array( + // The prefix configuration. If a non null value is be used, a random prefix + // will be generated instead. + // + // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#prefix + 'prefix' => 'WpToTwitter_Vendor', - // By default when running php-scoper add-prefix, it will prefix all relevant code found in the current working - // directory. You can however define which files should be scoped by defining a collection of Finders in the - // following configuration key. - // - // This configuration entry is completely ignored when using Box. - // - // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#finders-and-paths - 'finders' => [ - Finder::create() - ->files() - ->ignoreVCS(true) - ->notName('/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/') - ->exclude([ - 'doc', - 'test', - 'test_old', - 'tests', - 'Tests', - 'vendor-bin', - ]) - ->in(__DIR__ . '/src/vendor'), - Finder::create()->append([ - '../composer.json', - ]), - ], + // By default when running php-scoper add-prefix, it will prefix all relevant code found in the current working + // directory. You can however define which files should be scoped by defining a collection of Finders in the + // following configuration key. + // + // This configuration entry is completely ignored when using Box. + // + // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#finders-and-paths + 'finders' => array( + Finder::create() + ->files() + ->ignoreVCS( true ) + ->notName( '/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/' ) + ->exclude( + array( + 'doc', + 'test', + 'test_old', + 'tests', + 'Tests', + 'vendor-bin', + ) + )->in( __DIR__ . '/src/vendor' ), + Finder::create()->append( + array( + '../composer.json', + ) + ), + ), - // List of excluded files, i.e. files for which the content will be left untouched. - // Paths are relative to the configuration file unless if they are already absolute - // - // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#patchers - 'exclude-files' => [ - ], + // List of excluded files, i.e. files for which the content will be left untouched. + // Paths are relative to the configuration file unless if they are already absolute + // + // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#patchers + 'exclude-files' => array(), - // When scoping PHP files, there will be scenarios where some of the code being scoped indirectly references the - // original namespace. These will include, for example, strings or string manipulations. PHP-Scoper has limited - // support for prefixing such strings. To circumvent that, you can define patchers to manipulate the file to your - // heart contents. - // - // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#patchers - 'patchers' => [ - static function (string $filePath, string $prefix, string $contents): string { - // Change the contents here. + // When scoping PHP files, there will be scenarios where some of the code being scoped indirectly references the + // original namespace. These will include, for example, strings or string manipulations. PHP-Scoper has limited + // support for prefixing such strings. To circumvent that, you can define patchers to manipulate the file to your + // heart contents. + // + // For more see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#patchers + 'patchers' => array( + static function ( string $filePath, string $prefix, string $contents ): string { + // Change the contents here. - return $contents; - }, - ], + return $contents; + }, + ), - // List of symbols to consider internal i.e. to leave untouched. - // - // For more information see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#excluded-symbols - 'exclude-namespaces' => [ - // 'Acme\Foo' // The Acme\Foo namespace (and sub-namespaces) - // '~^PHPUnit\\\\Framework$~', // The whole namespace PHPUnit\Framework (but not sub-namespaces) - // '~^$~', // The root namespace only - // '', // Any namespace - ], - 'exclude-classes' => [ - // 'ReflectionClassConstant', - ], - 'exclude-functions' => [ - // 'mb_str_split', - ], - 'exclude-constants' => [ - // 'STDIN', - ], + // List of symbols to consider internal i.e. to leave untouched. + // + // For more information see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#excluded-symbols + 'exclude-namespaces' => array(), + 'exclude-classes' => array(), + 'exclude-functions' => array(), + 'exclude-constants' => array(), - // List of symbols to expose. - // - // For more information see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposed-symbols - 'expose-global-constants' => true, - 'expose-global-classes' => true, - 'expose-global-functions' => true, - 'expose-namespaces' => [ - // 'Acme\Foo' // The Acme\Foo namespace (and sub-namespaces) - // '~^PHPUnit\\\\Framework$~', // The whole namespace PHPUnit\Framework (but not sub-namespaces) - // '~^$~', // The root namespace only - // '', // Any namespace - ], - 'expose-classes' => [], - 'expose-functions' => [], - 'expose-constants' => [], -]; + // List of symbols to expose. + // For more information see: https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposed-symbols. + 'expose-global-constants' => true, + 'expose-global-classes' => true, + 'expose-global-functions' => true, + 'expose-namespaces' => array(), + 'expose-classes' => array(), + 'expose-functions' => array(), + 'expose-constants' => array(), + ];