Skip to content

Commit

Permalink
Add visibility to all class constants
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzap committed Nov 25, 2021
1 parent e16fa13 commit ce4032f
Show file tree
Hide file tree
Showing 27 changed files with 111 additions and 111 deletions.
10 changes: 5 additions & 5 deletions src/Cli/WpCliFileData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

final class WpCliFileData
{
const FILE = 'file';
const ARGS = 'args';
const SKIP_WORDPRESS = 'skip-wordpress';
const VALID = 'valid';
const DEFAULTS = [
public const FILE = 'file';
public const ARGS = 'args';
public const SKIP_WORDPRESS = 'skip-wordpress';
public const VALID = 'valid';
public const DEFAULTS = [
self::FILE => '',
self::ARGS => [],
self::SKIP_WORDPRESS => false,
Expand Down
16 changes: 8 additions & 8 deletions src/ComposerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ final class ComposerPlugin implements
CommandProvider
{

const EXTRA_KEY = 'wpstarter';
const EXTENSIONS_TYPE = 'wpstarter-extension';

const MODE = 'mode';
const MODE_NONE = 0;
const MODE_COMMAND = 1;
const MODE_COMPOSER_INSTALL = 4;
const MODE_COMPOSER_UPDATE = 8;
public const EXTRA_KEY = 'wpstarter';
public const EXTENSIONS_TYPE = 'wpstarter-extension';

public const MODE = 'mode';
public const MODE_NONE = 0;
public const MODE_COMMAND = 1;
public const MODE_COMPOSER_INSTALL = 4;
public const MODE_COMPOSER_UPDATE = 8;

/**
* @var bool
Expand Down
64 changes: 32 additions & 32 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,38 @@
*/
final class Config implements \ArrayAccess
{
const AUTOLOAD = 'autoload';
const CACHE_ENV = 'cache-env';
const COMMAND_STEPS = 'command-steps';
const COMPOSER_UPDATED_PACKAGES = 'composer-updated-packages';
const CONTENT_DEV_DIR = 'content-dev-dir';
const CONTENT_DEV_OPERATION = 'content-dev-op';
const CUSTOM_STEPS = 'custom-steps';
const DROPINS = 'dropins';
const EARLY_HOOKS_FILE = 'early-hook-file';
const ENV_BOOTSTRAP_DIR = 'env-bootstrap-dir';
const ENV_DIR = 'env-dir';
const ENV_EXAMPLE = 'env-example';
const ENV_FILE = 'env-file';
const INSTALL_WP_CLI = 'install-wp-cli';
const IS_COMPOSER_UPDATE = 'is-composer-update';
const IS_COMPOSER_INSTALL = 'is-composer-install';
const IS_WPSTARTER_COMMAND = 'is-wpstarter-command';
const IS_WPSTARTER_SELECTED_COMMAND = 'is-wpstarter-selected-command';
const MOVE_CONTENT = 'move-content';
const PREVENT_OVERWRITE = 'prevent-overwrite';
const REGISTER_THEME_FOLDER = 'register-theme-folder';
const REQUIRE_WP = 'require-wp';
const SCRIPTS = 'scripts';
const SKIP_DB_CHECK = 'skip-db-check';
const SKIP_STEPS = 'skip-steps';
const TEMPLATES_DIR = 'templates-dir';
const UNKNOWN_DROPINS = 'unknown-dropins';
const WP_CLI_COMMANDS = 'wp-cli-commands';
const WP_CLI_FILES = 'wp-cli-files';
const WP_VERSION = 'wp-version';
public const AUTOLOAD = 'autoload';
public const CACHE_ENV = 'cache-env';
public const COMMAND_STEPS = 'command-steps';
public const COMPOSER_UPDATED_PACKAGES = 'composer-updated-packages';
public const CONTENT_DEV_DIR = 'content-dev-dir';
public const CONTENT_DEV_OPERATION = 'content-dev-op';
public const CUSTOM_STEPS = 'custom-steps';
public const DROPINS = 'dropins';
public const EARLY_HOOKS_FILE = 'early-hook-file';
public const ENV_BOOTSTRAP_DIR = 'env-bootstrap-dir';
public const ENV_DIR = 'env-dir';
public const ENV_EXAMPLE = 'env-example';
public const ENV_FILE = 'env-file';
public const INSTALL_WP_CLI = 'install-wp-cli';
public const IS_COMPOSER_UPDATE = 'is-composer-update';
public const IS_COMPOSER_INSTALL = 'is-composer-install';
public const IS_WPSTARTER_COMMAND = 'is-wpstarter-command';
public const IS_WPSTARTER_SELECTED_COMMAND = 'is-wpstarter-selected-command';
public const MOVE_CONTENT = 'move-content';
public const PREVENT_OVERWRITE = 'prevent-overwrite';
public const REGISTER_THEME_FOLDER = 'register-theme-folder';
public const REQUIRE_WP = 'require-wp';
public const SCRIPTS = 'scripts';
public const SKIP_DB_CHECK = 'skip-db-check';
public const SKIP_STEPS = 'skip-steps';
public const TEMPLATES_DIR = 'templates-dir';
public const UNKNOWN_DROPINS = 'unknown-dropins';
public const WP_CLI_COMMANDS = 'wp-cli-commands';
public const WP_CLI_FILES = 'wp-cli-files';
public const WP_VERSION = 'wp-version';

const DEFAULTS = [
public const DEFAULTS = [
self::AUTOLOAD => 'wpstarter-autoload.php',
self::CACHE_ENV => true,
self::COMMAND_STEPS => null,
Expand Down Expand Up @@ -85,7 +85,7 @@ final class Config implements \ArrayAccess
self::WP_VERSION => null,
];

const VALIDATION_MAP = [
public const VALIDATION_MAP = [
self::AUTOLOAD => 'validatePath',
self::CACHE_ENV => 'validateBool',
self::COMMAND_STEPS => 'validateSteps',
Expand Down
14 changes: 7 additions & 7 deletions src/Env/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
*/
final class Filters
{
const FILTER_BOOL = 'bool';
const FILTER_INT = 'int';
const FILTER_INT_OR_BOOL = 'int|bool';
const FILTER_STRING_OR_BOOL = 'string|bool';
const FILTER_STRING = 'string';
const FILTER_OCTAL_MOD = 'mod';
const FILTER_TABLE_PREFIX = 'table-prefix';
public const FILTER_BOOL = 'bool';
public const FILTER_INT = 'int';
public const FILTER_INT_OR_BOOL = 'int|bool';
public const FILTER_STRING_OR_BOOL = 'string|bool';
public const FILTER_STRING = 'string';
public const FILTER_OCTAL_MOD = 'mod';
public const FILTER_TABLE_PREFIX = 'table-prefix';

/**
* @param string $name
Expand Down
24 changes: 12 additions & 12 deletions src/Env/WordPressEnvBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
class WordPressEnvBridge
{
const WP_CONSTANTS = [
public const WP_CONSTANTS = [
'ABSPATH' => Filters::FILTER_STRING,
'ADMIN_COOKIE_PATH' => Filters::FILTER_STRING,
'ALLOW_SUBDIRECTORY_INSTALL' => Filters::FILTER_BOOL,
Expand Down Expand Up @@ -179,16 +179,16 @@ class WordPressEnvBridge
'WP_USE_EXT_MYSQL' => Filters::FILTER_BOOL,
];

const CACHE_DUMP_FILE = '/.env.cached.php';
const CUSTOM_ENV_TO_CONST_VAR_NAME = 'WP_STARTER_ENV_TO_CONST';
const DB_TABLE_PREFIX_VAR_NAME = 'DB_TABLE_PREFIX';
const WP_ADMIN_COLOR_VAR_NAME = 'WP_ADMIN_COLOR';
const WP_FORCE_SSL_FORWARDED_PROTO_VAR_NAME = 'WP_FORCE_SSL_FORWARDED_PROTO';
const WP_INSTALLED_VAR_NAME = 'WP_INSTALLED';
const WPDB_ENV_VALID_VAR_NAME = 'WPDB_ENV_VALID';
const WPDB_EXISTS_VAR_NAME = 'WPDB_EXISTS';
public const CACHE_DUMP_FILE = '/.env.cached.php';
public const CUSTOM_ENV_TO_CONST_VAR_NAME = 'WP_STARTER_ENV_TO_CONST';
public const DB_TABLE_PREFIX_VAR_NAME = 'DB_TABLE_PREFIX';
public const WP_ADMIN_COLOR_VAR_NAME = 'WP_ADMIN_COLOR';
public const WP_FORCE_SSL_FORWARDED_PROTO_VAR_NAME = 'WP_FORCE_SSL_FORWARDED_PROTO';
public const WP_INSTALLED_VAR_NAME = 'WP_INSTALLED';
public const WPDB_ENV_VALID_VAR_NAME = 'WPDB_ENV_VALID';
public const WPDB_EXISTS_VAR_NAME = 'WPDB_EXISTS';

const WP_STARTER_VARS = [
public const WP_STARTER_VARS = [
self::CUSTOM_ENV_TO_CONST_VAR_NAME => Filters::FILTER_STRING,
self::DB_TABLE_PREFIX_VAR_NAME => Filters::FILTER_TABLE_PREFIX,
self::WP_ADMIN_COLOR_VAR_NAME => Filters::FILTER_STRING,
Expand All @@ -198,13 +198,13 @@ class WordPressEnvBridge
self::WPDB_EXISTS_VAR_NAME => Filters::FILTER_BOOL,
];

const WP_STARTER_ENV_VARS = [
public const WP_STARTER_ENV_VARS = [
'WP_ENV',
'WORDPRESS_ENV',
'WP_ENVIRONMENT_TYPE',
];

const ENV_TYPES = [
public const ENV_TYPES = [
'local' => 'local',
'development' => 'development',
'dev' => 'development',
Expand Down
2 changes: 1 addition & 1 deletion src/Io/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class Formatter
{
const DEFAULT_LINE_LENGTH = 58;
public const DEFAULT_LINE_LENGTH = 58;

/**
* @param int $lineLength
Expand Down
2 changes: 1 addition & 1 deletion src/Step/CheckPathStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
final class CheckPathStep implements BlockingStep, PostProcessStep
{
const NAME = 'check-paths';
public const NAME = 'check-paths';

/**
* @var \WeCodeMore\WpStarter\Util\Filesystem
Expand Down
10 changes: 5 additions & 5 deletions src/Step/ContentDevStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
*/
final class ContentDevStep implements OptionalStep
{
const NAME = 'publish-content-dev';
const OP_COPY = 'copy';
const OP_SYMLINK = 'symlink';
const OP_NONE = 'none';
const OPERATIONS = [self::OP_COPY, self::OP_SYMLINK, self::OP_NONE];
public const NAME = 'publish-content-dev';
public const OP_COPY = 'copy';
public const OP_SYMLINK = 'symlink';
public const OP_NONE = 'none';
public const OPERATIONS = [self::OP_COPY, self::OP_SYMLINK, self::OP_NONE];

/**
* @var \WeCodeMore\WpStarter\Util\Filesystem
Expand Down
4 changes: 2 additions & 2 deletions src/Step/DropinStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
*/
final class DropinStep implements FileCreationStepInterface
{
const ACTION_COPY = 'copy';
const ACTION_DOWNLOAD = 'download';
public const ACTION_COPY = 'copy';
public const ACTION_DOWNLOAD = 'download';

/**
* @var string
Expand Down
4 changes: 2 additions & 2 deletions src/Step/DropinsStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
*/
final class DropinsStep implements Step
{
const NAME = 'dropins';
public const NAME = 'dropins';

const DROPINS = [
public const DROPINS = [
'advanced-cache.php',
'db.php',
'db-error.php',
Expand Down
2 changes: 1 addition & 1 deletion src/Step/EnvExampleStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
final class EnvExampleStep implements FileCreationStepInterface, OptionalStep
{
const NAME = 'build-env-example';
public const NAME = 'build-env-example';

/**
* @var Config
Expand Down
2 changes: 1 addition & 1 deletion src/Step/FlushEnvCacheStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
final class FlushEnvCacheStep implements Step
{
const NAME = 'flush-env-cache';
public const NAME = 'flush-env-cache';

/**
* @return string
Expand Down
2 changes: 1 addition & 1 deletion src/Step/IndexStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
final class IndexStep implements FileCreationStepInterface, BlockingStep
{
const NAME = 'build-index';
public const NAME = 'build-index';

/**
* @var \WeCodeMore\WpStarter\Util\FileContentBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Step/MoveContentStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
final class MoveContentStep implements OptionalStep
{
const NAME = 'move-content';
public const NAME = 'move-content';

/**
* @var \WeCodeMore\WpStarter\Util\Filesystem
Expand Down
4 changes: 2 additions & 2 deletions src/Step/MuLoaderStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*/
final class MuLoaderStep implements FileCreationStepInterface
{
const NAME = 'build-mu-loader';
const TARGET_FILE_NAME = 'wpstarter-mu-loader.php';
public const NAME = 'build-mu-loader';
public const TARGET_FILE_NAME = 'wpstarter-mu-loader.php';

/**
* @var \WeCodeMore\WpStarter\Util\MuPluginList
Expand Down
2 changes: 1 addition & 1 deletion src/Step/OptionalStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
interface OptionalStep extends Step
{
const ASK = 'ask';
public const ASK = 'ask';

/**
* Ask a confirmation and return result.
Expand Down
6 changes: 3 additions & 3 deletions src/Step/Step.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/
interface Step
{
const ERROR = 1;
const SUCCESS = 2;
const NONE = 4;
public const ERROR = 1;
public const SUCCESS = 2;
public const NONE = 4;

/**
* Return an unique name for the step.
Expand Down
2 changes: 1 addition & 1 deletion src/Step/WpCliCommandsStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
final class WpCliCommandsStep implements Step
{

const NAME = 'wp-cli';
public const NAME = 'wp-cli';

/**
* @var Io
Expand Down
2 changes: 1 addition & 1 deletion src/Step/WpCliConfigStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
final class WpCliConfigStep implements FileCreationStepInterface
{
const NAME = 'build-wp-cli-yml';
public const NAME = 'build-wp-cli-yml';

/**
* @var Util\FileContentBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/Step/WpConfigStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
final class WpConfigStep implements FileCreationStepInterface, BlockingStep
{
const NAME = 'build-wp-config';
public const NAME = 'build-wp-config';

/**
* @var \WeCodeMore\WpStarter\Io\Io
Expand Down
6 changes: 3 additions & 3 deletions src/Util/DbChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*/
class DbChecker
{
const WP_INSTALLED = 'WP_INSTALLED';
const WPDB_EXISTS = 'WPDB_EXISTS';
const WPDB_ENV_VALID = 'WPDB_ENV_VALID';
public const WP_INSTALLED = 'WP_INSTALLED';
public const WPDB_EXISTS = 'WPDB_EXISTS';
public const WPDB_ENV_VALID = 'WPDB_ENV_VALID';

/**
* @var WordPressEnvBridge
Expand Down
14 changes: 7 additions & 7 deletions src/Util/Paths.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
*/
final class Paths implements \ArrayAccess
{
const ROOT = 'root';
const VENDOR = 'vendor';
const BIN = 'bin';
const WP = 'wp';
const WP_PARENT = 'wp-parent';
const WP_CONTENT = 'wp-content';
const WP_STARTER = 'wp-starter';
public const ROOT = 'root';
public const VENDOR = 'vendor';
public const BIN = 'bin';
public const WP = 'wp';
public const WP_PARENT = 'wp-parent';
public const WP_CONTENT = 'wp-content';
public const WP_STARTER = 'wp-starter';

/**
* @var Config
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
final class Requirements
{
const CONFIG_FILE = 'wpstarter.json';
public const CONFIG_FILE = 'wpstarter.json';

/**
* @var Filesystem
Expand Down
Loading

0 comments on commit ce4032f

Please sign in to comment.