1414
1515namespace Humbug \PhpScoper ;
1616
17- use Closure ;
1817use InvalidArgumentException ;
1918use Iterator ;
2019use RuntimeException ;
2120use SplFileInfo ;
2221use Symfony \Component \Filesystem \Filesystem ;
2322use Symfony \Component \Finder \Finder ;
2423use const DIRECTORY_SEPARATOR ;
24+ use function array_key_exists ;
2525use function dirname ;
2626use function file_exists ;
2727use function gettype ;
@@ -138,16 +138,15 @@ public static function load(string $path = null, array $paths = []): self
138138 }
139139
140140 /**
141- * @param string|null $path Absolute path to the configuration file loaded.
142- * @param string|null $prefix The prefix applied.
143- * @param [string, string][] $filesWithContents Array of tuple with the first argument being the file path and the second its contents
144- * @param callable[] $patchers List of closures which can alter the content of the files being
145- * scoped.
146- * @param Whitelist $whitelist List of classes that will not be scoped.
147- * @param Closure $globalNamespaceWhitelisters Closure taking a class name from the global namespace as an argument and
148- * returning a boolean which if `true` means the class should be scoped
149- * (i.e. is ignored) or scoped otherwise.
150- * @param string[] $whitelistedFiles List of absolute paths of files to completely ignore
141+ * @param string|null $path Absolute path to the configuration file loaded.
142+ * @param string|null $prefix The prefix applied.
143+ * @param string[][] $filesWithContents Array of tuple with the first argument being the file path and the second its contents
144+ * @param callable[] $patchers List of closures which can alter the content of the files being
145+ * scoped.
146+ * @param Whitelist $whitelist List of classes that will not be scoped.
147+ * returning a boolean which if `true` means the class should be scoped
148+ * (i.e. is ignored) or scoped otherwise.
149+ * @param string[] $whitelistedFiles List of absolute paths of files to completely ignore
151150 */
152151 private function __construct (
153152 ?string $ path ,
@@ -238,7 +237,7 @@ public function getWhitelistedFiles(): array
238237 private static function validateConfigKeys (array $ config ): void
239238 {
240239 array_map (
241- [ ' self ' , ' validateConfigKey '] ,
240+ self ::class. ' :: validateConfigKey ' ,
242241 array_keys ($ config )
243242 );
244243 }
@@ -263,7 +262,7 @@ private static function validateConfigKey(string $key): void
263262 */
264263 private static function retrievePrefix (array $ config ): ?string
265264 {
266- $ prefix = array_key_exists ( self :: PREFIX_KEYWORD , $ config) ? $ config [self ::PREFIX_KEYWORD ] : null ;
265+ $ prefix = $ config [self ::PREFIX_KEYWORD ] ?? null ;
267266
268267 if (null === $ prefix ) {
269268 return null ;
@@ -515,7 +514,7 @@ private static function retrieveFilesFromPaths(array $paths): iterable
515514 /**
516515 * @param Iterator $files
517516 *
518- * @return [ string, string ][] Array of tuple with the first argument being the file path and the second its contents
517+ * @return string[ ][] Array of tuple with the first argument being the file path and the second its contents
519518 */
520519 private static function retrieveFilesWithContents (Iterator $ files ): array
521520 {
0 commit comments