@@ -602,8 +602,8 @@ protected function generate_ext_json_file(array $packages)
602602 if (is_int ($ name ))
603603 {
604604 // Numeric key means just a name
605- $ pkgName = $ constraint ;
606- $ unconstrained [$ pkgName ] = true ;
605+ $ package_name = $ constraint ;
606+ $ unconstrained [$ package_name ] = true ;
607607 }
608608 else
609609 {
@@ -618,14 +618,14 @@ protected function generate_ext_json_file(array $packages)
618618 if (!empty ($ unconstrained ))
619619 {
620620 // Load composer on the just-written file so repositories and core constraints are available
621- $ extComposer = $ this ->get_composer ($ this ->get_composer_ext_json_filename ());
621+ $ ext_composer = $ this ->get_composer ($ this ->get_composer_ext_json_filename ());
622622
623623 /** @var ConstraintInterface $core_constraint */
624- $ core_constraint = $ extComposer ->getPackage ()->getRequires ()['phpbb/phpbb ' ]->getConstraint ();
625- $ core_stability = $ extComposer ->getPackage ()->getMinimumStability ();
624+ $ core_constraint = $ ext_composer ->getPackage ()->getRequires ()['phpbb/phpbb ' ]->getConstraint ();
625+ $ core_stability = $ ext_composer ->getPackage ()->getMinimumStability ();
626626
627627 // Resolve highest compatible versions for each unconstrained package
628- $ pins = $ this ->resolve_highest_versions (array_keys ($ unconstrained ), $ extComposer , $ core_constraint , $ core_stability );
628+ $ pins = $ this ->resolve_highest_versions (array_keys ($ unconstrained ), $ ext_composer , $ core_constraint , $ core_stability );
629629
630630 if (!empty ($ pins ))
631631 {
@@ -651,13 +651,13 @@ protected function generate_ext_json_file(array $packages)
651651 * Resolve the highest compatible versions for the given package names
652652 * based on repositories and phpBB/PHP constraints from the provided Composer instance.
653653 *
654- * @param array $packageNames list of package names to resolve
654+ * @param array $package_names list of package names to resolve
655655 * @param Composer|PartialComposer $composer Composer instance configured with repositories
656656 * @param ConstraintInterface $core_constraint phpBB version constraint
657657 * @param string $core_stability minimum stability
658658 * @return array [packageName => prettyVersion]
659659 */
660- private function resolve_highest_versions (array $ packageNames , $ composer , ConstraintInterface $ core_constraint , $ core_stability ): array
660+ protected function resolve_highest_versions (array $ package_names , $ composer , ConstraintInterface $ core_constraint , $ core_stability ): array
661661 {
662662 $ io = new NullIO ();
663663
@@ -670,7 +670,7 @@ private function resolve_highest_versions(array $packageNames, $composer, Constr
670670 {
671671 if ($ repository instanceof ComposerRepository)
672672 {
673- foreach ($ packageNames as $ name )
673+ foreach ($ package_names as $ name )
674674 {
675675 $ versions = $ repository ->findPackages ($ name );
676676 if (!empty ($ versions ))
@@ -682,17 +682,17 @@ private function resolve_highest_versions(array $packageNames, $composer, Constr
682682 else
683683 {
684684 // Preload and filter by name for non-composer repositories
685- $ byName = [];
686- foreach ($ repository ->getPackages () as $ pkg )
685+ $ package_name = [];
686+ foreach ($ repository ->getPackages () as $ package )
687687 {
688- $ n = $ pkg ->getName ();
689- if (in_array ($ n , $ packageNames , true ))
688+ $ name = $ package ->getName ();
689+ if (in_array ($ name , $ package_names , true ))
690690 {
691- $ byName [ $ n ][] = $ pkg ;
691+ $ package_name [ $ name ][] = $ package ;
692692 }
693693 }
694694
695- foreach ($ byName as $ name => $ versions )
695+ foreach ($ package_name as $ name => $ versions )
696696 {
697697 $ compatible_packages = $ this ->get_compatible_versions ($ compatible_packages , $ core_constraint , $ core_stability , $ name , $ versions );
698698 }
@@ -705,7 +705,7 @@ private function resolve_highest_versions(array $packageNames, $composer, Constr
705705 }
706706
707707 $ pins = [];
708- foreach ($ packageNames as $ name )
708+ foreach ($ package_names as $ name )
709709 {
710710 if (empty ($ compatible_packages [$ name ]))
711711 {
0 commit comments