Perl::...Factory(3pm)
πΈ NAME πΈ
okay so this page is Perl::...Factory(3pm) β your User Contributed Perl Documentation moment β and the actual thing it's documenting is Perl::Critic::PolicyFactory, which literally instantiates Policy objects. that's the whole job bestie π
β¨ DESCRIPTION β¨
so Perl::Critic::PolicyFactory is a helper class π«Ά its whole personality is instantiating Perl::Critic::Policy objects with your preferred parameters. that's it, that's the vibe.
and like β there are no user-serviceable parts here. none. zero. don't go poking around inside, it's giving "do not open, sealed for freshness" π₯
π INTERFACE SUPPORT π
heads up bestie, this is considered to be a non-public class π its interface is subject to change without notice. so like, don't get too attached to how it looks rn, it might glow up (or glow down) at any moment. no cap.
π CONSTRUCTOR π
new( -profile => $profile, -errors => $config_errors )β returns a reference to a brand newPerl::Critic::PolicyFactoryobject β¨-profileis a reference to aPerl::Critic::UserProfileobject. this argument is required β like, you cannot skip it, it's not optional, it's the main character π-errorsis a reference to an instance ofPerl::Critic::ConfigErrors. this argument is optional. if you do specify it, then any problems found will be added to the object π©Ή
π¦ METHODS π¦
create_policy( -name => $policy_name, -params => \%param_hash )β creates one Policy object. if the object cannot be instantiated, it will throw a fatal exception π otherwise, it returns a reference to the new Policy object. slay.-nameis the name of aPerl::Critic::Policysubclass module. the'Perl::Critic::Policy'portion of the name can be omitted for brevity (iykyk, we keep it short). this argument is required β-paramsis an optional reference to hash of parameters that will be passed into the constructor of the Policy. if-paramsis not defined, we will use the appropriate Policy parameters from thePerl::Critic::UserProfileπ§
note that the Policy will not have hadinitialize_if_enabledinPerl::Critic::Policyinvoked on it, so it may not yet be usable π like it exists but it's not ready-ready, y'know?
create_all_policies()β constructs and returns one instance of eachPerl::Critic::Policysubclass that is installed on the local system π each Policy will be created with the appropriate parameters from the user's configuration profile. it's giving "collect the whole set" energy.
note that the Policies will not have hadinitialize_if_enabledinPerl::Critic::Policyinvoked on them, so they may not yet be usable π same situation, they're cute but not fully loaded.
πΈ SUBROUTINES πΈ
Perl::Critic::PolicyFactory has a few static subroutines that are used internally, but may be useful to you in some way π (little bonus treats, fr fr)
site_policy_names()β returns a list of all the Policy modules that are currently installed in thePerl::Critic:Policynamespace π these will include modules that are distributed withPerl::Criticplus any third-party modules that have been installed. periodt.
π AUTHOR π
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β the icon, the legend π
π COPYRIGHT π
Copyright (c) 2005-2011 Imaginative Software Systems
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. the full text of this license can be found in the LICENSE file included with this module πβ¨
okay that's the whole page bestie, go forth and instantiate responsibly π«Άπ
perl v5.42.0 Β· 2024-10-23 Β· Perl::...Factory(3pm) β mwah, that's a wrap ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Perl-Critic 1.156.0-bp160.1.1 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms