Skip to content

Commit

Permalink
fix coding style issues (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimmi20 authored and mrook committed Oct 25, 2019
1 parent c6396dc commit 9f5552c
Show file tree
Hide file tree
Showing 64 changed files with 559 additions and 474 deletions.
30 changes: 15 additions & 15 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[{*.php,*.xml}]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
*.sh text eol=lf
hlsaxon text eol=lf

.dockerignore text eol=lf
.editorconfig text eol=lf
.gitattributes text eol=lf
.gitignore text eol=lf

docs export-ignore
test export-ignore
.travis.* export-ignore
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bin/*
!bin/phing*
.vagrant
**/*.log
**/*.log.txt
ansible/playbook.retry
test/etc/tasks/system/defaultexcludestestinput/
test/etc/types/selectors/tmp/
10 changes: 5 additions & 5 deletions classes/phing/ComponentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
class ComponentHelper
{
const COMPONENT_HELPER_REFERENCE = "phing.ComponentHelper";
public const COMPONENT_HELPER_REFERENCE = "phing.ComponentHelper";

/**
* @var Project
Expand Down Expand Up @@ -140,11 +140,11 @@ public function addDataTypeDefinition($typeName, $typeClass, $classpath = null)
}
}

public static function getElementName(Project $p = null, $o, $brief = false)
public static function getElementName(Project $p = null, $o = null, $brief = false)
{
if ($p === null) {
// TODO Project::getProject($o)
}
//if ($p === null) {
// TODO Project::getProject($o)
//}

return $p === null
? self::getUnmappedElementName($o, $brief)
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/Phing.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Phing
public static function start($args, array $additionalUserProperties = null)
{
try {
$m = new Phing();
$m = new self();
$m->execute($args);
} catch (Exception $exc) {
self::handleLogfile();
Expand Down Expand Up @@ -251,7 +251,7 @@ protected static function statusExit($exitCode)
/**
* Prints the message of the Exception if it's not null.
*
* @param Exception $t
* @param Throwable $t
*/
public static function printMessage(Throwable $t)
{
Expand Down
10 changes: 5 additions & 5 deletions classes/phing/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class Project
{

// Logging level constants.
const MSG_DEBUG = 4;
const MSG_VERBOSE = 3;
const MSG_INFO = 2;
const MSG_WARN = 1;
const MSG_ERR = 0;
public const MSG_DEBUG = 4;
public const MSG_VERBOSE = 3;
public const MSG_INFO = 2;
public const MSG_WARN = 1;
public const MSG_ERR = 0;

/**
* contains the targets
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/filters/HeadFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class HeadFilter extends BaseParamFilterReader implements ChainableReader
/**
* Parameter name for the number of lines to be returned.
*/
const LINES_KEY = "lines";
public const LINES_KEY = "lines";

/**
* Parameter name for the number of lines to be skipped.
*/
const SKIP_KEY = 'skip';
public const SKIP_KEY = 'skip';

/**
* Number of lines currently read in.
Expand Down
6 changes: 3 additions & 3 deletions classes/phing/filters/LineContainsRegexp.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class LineContainsRegexp extends BaseParamFilterReader implements ChainableReade
*
* @var string
*/
const REGEXP_KEY = "regexp";
const NEGATE_KEY = 'negate';
const CS_KEY = 'casesensitive';
public const REGEXP_KEY = "regexp";
public const NEGATE_KEY = 'negate';
public const CS_KEY = 'casesensitive';

/**
* Regular expressions that are applied against lines.
Expand Down
2 changes: 1 addition & 1 deletion classes/phing/filters/PhpArrayMapLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PhpArrayMapLines extends BaseParamFilterReader implements ChainableReader
*
* @var string
*/
const FUNCTION_KEY = "function";
public const FUNCTION_KEY = "function";

/**
* The function to be used.
Expand Down
2 changes: 1 addition & 1 deletion classes/phing/filters/PrefixLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PrefixLines extends BaseParamFilterReader implements ChainableReader
*
* @var string
*/
const PREFIX_KEY = "lines";
public const PREFIX_KEY = "lines";

/**
* The prefix to be used.
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/filters/ReplaceTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ class ReplaceTokens extends BaseParamFilterReader implements ChainableReader
*
* @var string
*/
const DEFAULT_BEGIN_TOKEN = "@";
public const DEFAULT_BEGIN_TOKEN = "@";

/**
* Default "end token" character.
*
* @var string
*/
const DEFAULT_END_TOKEN = "@";
public const DEFAULT_END_TOKEN = "@";

/**
* Array to hold the replacee-replacer pairs (String to String).
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/filters/ReplaceTokensWithFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ class ReplaceTokensWithFile extends BaseParamFilterReader implements ChainableRe
*
* @var string
*/
const DEFAULT_BEGIN_TOKEN = "#@#";
public const DEFAULT_BEGIN_TOKEN = "#@#";

/**
* Default "end token" character.
*
* @var string
*/
const DEFAULT_END_TOKEN = "#@#";
public const DEFAULT_END_TOKEN = "#@#";

/**
* Array to hold the token sources that make tokens from
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/filters/StripLineBreaks.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class StripLineBreaks extends BaseParamFilterReader implements ChainableReader
*
* @var string
*/
const DEFAULT_LINE_BREAKS = "\r\n";
public const DEFAULT_LINE_BREAKS = "\r\n";

/**
* Parameter name for the line-breaking characters parameter.
*
* @var string
*/
const LINES_BREAKS_KEY = "linebreaks";
public const LINES_BREAKS_KEY = "linebreaks";

/**
* The characters that are recognized as line breaks.
Expand Down
2 changes: 1 addition & 1 deletion classes/phing/filters/StripLineComments.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class StripLineComments extends BaseParamFilterReader implements ChainableReader
/**
* Parameter name for the comment prefix.
*/
const COMMENTS_KEY = "comment";
public const COMMENTS_KEY = "comment";

/**
* Array that holds the comment prefixes.
Expand Down
2 changes: 1 addition & 1 deletion classes/phing/filters/SuffixLines.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SuffixLines extends BaseParamFilterReader implements ChainableReader
*
* @var string
*/
const SUFFIX_KEY = "suffix";
public const SUFFIX_KEY = "suffix";

/**
* The suffix to be used.
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/filters/TabToSpaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ class TabToSpaces extends BaseParamFilterReader implements ChainableReader
*
* @var int
*/
const DEFAULT_TAB_LENGTH = 8;
public const DEFAULT_TAB_LENGTH = 8;

/**
* Parameter name for the length of a tab.
*
* @var string
*/
const TAB_LENGTH_KEY = "tablength";
public const TAB_LENGTH_KEY = "tablength";

/**
* Tab length in this filter.
Expand Down
4 changes: 2 additions & 2 deletions classes/phing/filters/TailFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class TailFilter extends BaseParamFilterReader implements ChainableReader
*
* @var string
*/
const LINES_KEY = "lines";
public const LINES_KEY = "lines";

/**
* Parameter name for the number of lines to be skipped.
*/
const SKIP_KEY = "skip";
public const SKIP_KEY = "skip";

/**
* Number of lines to be returned in the filtered stream.
Expand Down
6 changes: 3 additions & 3 deletions classes/phing/filters/TranslateGettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class TranslateGettext extends BaseParamFilterReader implements ChainableReader

// constants for specifying keys to expect
// when this is called using <filterreader ... />
const DOMAIN_KEY = "domain";
const DIR_KEY = "dir";
const LOCALE_KEY = "locale";
public const DOMAIN_KEY = "domain";
public const DIR_KEY = "dir";
public const LOCALE_KEY = "locale";

/**
* The domain to use
Expand Down
2 changes: 1 addition & 1 deletion classes/phing/input/NoInteractionInputHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/

/**
* Plugin to Phing to disable user input.
*
Expand Down
54 changes: 27 additions & 27 deletions classes/phing/listener/AnsiColorLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,36 +93,36 @@
*/
class AnsiColorLogger extends DefaultLogger
{
const ATTR_NORMAL = 0;
const ATTR_BRIGHT = 1;
const ATTR_DIM = 2;
const ATTR_UNDERLINE = 3;
const ATTR_BLINK = 5;
const ATTR_REVERSE = 7;
const ATTR_HIDDEN = 8;
public const ATTR_NORMAL = 0;
public const ATTR_BRIGHT = 1;
public const ATTR_DIM = 2;
public const ATTR_UNDERLINE = 3;
public const ATTR_BLINK = 5;
public const ATTR_REVERSE = 7;
public const ATTR_HIDDEN = 8;

const FG_BLACK = 30;
const FG_RED = 31;
const FG_GREEN = 32;
const FG_YELLOW = 33;
const FG_BLUE = 34;
const FG_MAGENTA = 35;
const FG_CYAN = 36;
const FG_WHITE = 37;
public const FG_BLACK = 30;
public const FG_RED = 31;
public const FG_GREEN = 32;
public const FG_YELLOW = 33;
public const FG_BLUE = 34;
public const FG_MAGENTA = 35;
public const FG_CYAN = 36;
public const FG_WHITE = 37;

const BG_BLACK = 40;
const BG_RED = 41;
const BG_GREEN = 42;
const BG_YELLOW = 44;
const BG_BLUE = 44;
const BG_MAGENTA = 45;
const BG_CYAN = 46;
const BG_WHITE = 47;
public const BG_BLACK = 40;
public const BG_RED = 41;
public const BG_GREEN = 42;
public const BG_YELLOW = 44;
public const BG_BLUE = 44;
public const BG_MAGENTA = 45;
public const BG_CYAN = 46;
public const BG_WHITE = 47;

const PREFIX = "\x1b[";
const SUFFIX = "m";
const SEPARATOR = ';';
const END_COLOR = "\x1b[0m"; // self::PREFIX . self::SUFFIX;
public const PREFIX = "\x1b[";
public const SUFFIX = "m";
public const SEPARATOR = ';';
public const END_COLOR = "\x1b[0m"; // self::PREFIX . self::SUFFIX;

private $errColor;
private $warnColor;
Expand Down
2 changes: 1 addition & 1 deletion classes/phing/listener/DefaultLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DefaultLogger implements StreamRequiredBuildLogger
*
* @var int
*/
const LEFT_COLUMN_SIZE = 12;
public const LEFT_COLUMN_SIZE = 12;

/**
* The message output level that should be used. The default is
Expand Down
16 changes: 8 additions & 8 deletions classes/phing/listener/HtmlColorLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
*/
class HtmlColorLogger extends DefaultLogger
{
const CLASS_ERR = 'phing_err';
const CLASS_VERBOSE = 'phing_verbose';
const CLASS_DEBUG = 'phing_debug';
const CLASS_WARN = 'phing_warn';
const CLASS_INFO = 'phing_info';
public const CLASS_ERR = 'phing_err';
public const CLASS_VERBOSE = 'phing_verbose';
public const CLASS_DEBUG = 'phing_debug';
public const CLASS_WARN = 'phing_warn';
public const CLASS_INFO = 'phing_info';

const PREFIX = '<span class="';
const SUFFIX = '">';
const END_COLOR = '</span>';
public const PREFIX = '<span class="';
public const SUFFIX = '">';
public const END_COLOR = '</span>';

private $errColor;
private $warnColor;
Expand Down
Loading

0 comments on commit 9f5552c

Please sign in to comment.