App-perlimports

 view release on metacpan or  search on metacpan

lib/App/perlimports/Document.pm  view on Meta::CPAN

# list of PPI::Statement::Include (use, no, require)
# (excluding pragmas, ignored modules, and 'use VERSION')
has includes => (
    is          => 'ro',
    isa         => ArrayRef [Object],    # PPI::Statement::Include
    handles_via => 'Array',
    handles     => {
        all_includes => 'elements',
    },
    lazy    => 1,
    builder => '_build_includes',
);

# constant subs defined using 'use constant'
has constants => (
    is          => 'ro',
    isa         => HashRef,
    handles_via => 'Hash',
    handles     => {
        is_constant_name => 'exists',
        all_constants    => 'keys',
        _set_constants   => 'set',
    },
    predicate => '_has_constants',
    lazy      => 1,
    builder   => '_build_constants',
);

has _inspectors => (
    is          => 'ro',
    isa         => HashRef [ Maybe [Object] ],
    handles_via => 'Hash',
    handles     => {
        all_inspector_names => 'keys',
        _get_inspector_for  => 'get',
        _has_inspector_for  => 'exists',
        _set_inspector_for  => 'set',
    },
    lazy    => 1,
    default => sub { +{} },
);

# catalog of variables seen in interpolated context (string, qr, et al)
has interpolated_symbols => (
    is      => 'ro',
    isa     => HashRef,
    lazy    => 1,
    builder => '_build_interpolated_symbols',
);

# (lint mode only) whether to output json (or else console text)
has json => (
    is      => 'ro',
    isa     => Bool,
    lazy    => 1,
    default => 0,
);

has _json_encoder => (
    is      => 'ro',
    isa     => InstanceOf ['Cpanel::JSON::XS'],
    lazy    => 1,
    default => sub {
        require Cpanel::JSON::XS;
        return Cpanel::JSON::XS->new;
    },
);

# are we processing in lint mode ? (otherwise edit mode)
has lint => (
    is      => 'ro',
    isa     => Bool,
    lazy    => 1,
    default => 0,
);

has my_own_inspector => (
    is      => 'ro',
    isa     => Maybe [ InstanceOf ['App::perlimports::ExportInspector'] ],
    lazy    => 1,
    builder => '_build_my_own_inspector',
);

has never_exports => (
    is      => 'ro',
    isa     => HashRef,
    lazy    => 1,
    builder => '_build_never_exports',
);

has _never_export_modules => (
    is        => 'ro',
    isa       => ArrayRef [Str],
    init_arg  => 'never_export_modules',
    predicate => '_has_never_export_modules',
);

# catalog of symbols explicitly imported (by package), e.g.
#  Carp => ['croak', ..], ...
# in edit mode, this will be altered after processing (tidied_document)
# to reflect what we think the import statement should be.
has found_imports => (
    is          => 'ro',
    isa         => HashRef,
    handles_via => 'Hash',
    handles     => {
        _reset_found_import => 'set',
    },
    lazy    => 1,
    builder => '_build_found_imports',
);

has _indent => (
    is       => 'ro',
    isa      => Int,
    init_arg => 'indent',
    default  => 4,
);

has _pad_brackets => (
    is       => 'ro',
    isa      => Bool,
    init_arg => 'pad_brackets',
    default  => 0,
);



( run in 1.010 second using v1.01-cache-2.11-cpan-d8267643d1d )