Skip to content

Commit

Permalink
Merge pull request #447 from bastelfreak/fail
Browse files Browse the repository at this point in the history
mark private classes with assert_private()
  • Loading branch information
bastelfreak authored May 5, 2018
2 parents 6d7b898 + a31906a commit 1bba491
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 42 deletions.
4 changes: 1 addition & 3 deletions manifests/apache_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
Hash $settings = {}
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::apache_config is private')
}
assert_private()

$real_settings = deep_merge($settings, hiera_hash('php::apache::settings', {}))

Expand Down
4 changes: 1 addition & 3 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
Hash $settings = {}
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::cli is private')
}
assert_private()

$real_settings = deep_merge($settings, hiera_hash('php::cli::settings', {}))

Expand Down
4 changes: 1 addition & 3 deletions manifests/composer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
Variant[Integer, String] $root_group = $php::params::root_group,
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::composer is private')
}
assert_private()

archive { 'download composer':
path => $path,
Expand Down
5 changes: 2 additions & 3 deletions manifests/composer/auto_update.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
$proxy_server = undef,
) {

if $caller_module_name != $module_name {
warning('php::composer::auto_update is private')
}
assert_private()


if $proxy_type and $proxy_server {
$env = [ 'HOME=/root', "${proxy_type}_proxy=${proxy_server}" ]
Expand Down
5 changes: 2 additions & 3 deletions manifests/config/setting.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
Stdlib::Absolutepath $file,
) {

if $caller_module_name != $module_name {
warning('php::config::setting is private')
}

assert_private()

$split_name = split($key, '/')
if count($split_name) == 1 {
Expand Down
4 changes: 1 addition & 3 deletions manifests/dev.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
Boolean $manage_repos = $php::manage_repos,
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::dev is private')
}
assert_private()

# On FreeBSD there is no 'devel' package.
$real_package = $facts['os']['family'] ? {
Expand Down
4 changes: 1 addition & 3 deletions manifests/embedded.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
Hash $settings = {},
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::embedded is private')
}
assert_private()

$real_settings = deep_merge(
$settings,
Expand Down
4 changes: 1 addition & 3 deletions manifests/fpm/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@
String $syslog_ident = 'php-fpm',
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::fpm::config is private')
}
assert_private()

# Hack-ish to default to user for group too
$log_group_final = $log_group ? {
Expand Down
4 changes: 1 addition & 3 deletions manifests/global.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
Hash $settings = {}
) inherits ::php {

if $caller_module_name != $module_name {
warning('php::global is private')
}
assert_private()

# No deep merging required since the settings we have are the global settings.
$real_settings = $settings
Expand Down
4 changes: 1 addition & 3 deletions manifests/packages.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
Array $names = $php::params::common_package_names,
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::packages is private')
}
assert_private()

$real_names = union($names, $names_to_prefix)
if $facts['os']['family'] == 'debian' {
Expand Down
4 changes: 1 addition & 3 deletions manifests/pear.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
Boolean $manage_repos = $php::manage_repos,
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::pear is private')
}
assert_private()

# Defaults for the pear package name
if $package {
Expand Down
4 changes: 1 addition & 3 deletions manifests/phpunit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
Integer $max_age = $php::params::phpunit_max_age,
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::phpunit is private')
}
assert_private()

ensure_packages(['wget'])

Expand Down
4 changes: 1 addition & 3 deletions manifests/phpunit/auto_update.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
$path,
) {

if $caller_module_name != $module_name {
warning('php::phpunit::auto_update is private')
}
assert_private()

exec { 'update phpunit':
command => "wget ${source} -O ${path}",
Expand Down
4 changes: 1 addition & 3 deletions manifests/repo/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
$sury = true,
) {

if $caller_module_name != $module_name {
warning('php::repo::debian is private')
}
assert_private()

include '::apt'

Expand Down

0 comments on commit 1bba491

Please sign in to comment.