Fixed whitespace

This commit is contained in:
rr- 2015-11-25 09:48:03 +01:00
parent b8f90dbd95
commit 13d77dd14a
57 changed files with 3545 additions and 3539 deletions

View file

@ -145,12 +145,6 @@
<!-- Indentation -->
<!-- **************** -->
<!-- Tests to make sure that a line does not contain the tab character. -->
<test name="indentation"> <!-- noTabs -->
<property name="type" value="tabs"/> <!-- tabs or spaces -->
<property name="number" value="4"/> <!-- number of spaces if type = spaces -->
</test>
<!-- Check the position of the open curly brace in a control structure (if) -->
<!-- sl = same line -->
<!-- nl = new line -->

View file

@ -70,9 +70,9 @@ class FileDao implements IFileDao
$from = explode('/', str_replace('\\', '/', $from));
$to = explode('/', str_replace('\\', '/', $to));
$relPath = $to;
foreach($from as $depth => $dir)
foreach ($from as $depth => $dir)
{
if($dir === $to[$depth])
if ($dir === $to[$depth])
{
array_shift($relPath);
}

View file

@ -108,7 +108,7 @@ class EnumHelper
throw new \DomainException(sprintf(
'Unrecognized value: %s.' . PHP_EOL . 'Possible values: %s',
$enumString,
join(', ', array_keys($lowerEnumMap))));
implode(', ', array_keys($lowerEnumMap))));
}
return $lowerEnumMap[$key];

View file

@ -39,7 +39,7 @@ class HttpHelper
$result = [];
foreach ($_SERVER as $key => $value)
{
if (substr($key, 0, 5) == "HTTP_")
if (substr($key, 0, 5) === "HTTP_")
{
$key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($key, 5)))));
$result[$key] = $value;

View file

@ -33,7 +33,12 @@ abstract class AbstractSearchParserConfig
throw new NotSupportedException('Unknown order term: ' . $tokenValue
. '. Possible order terms: '
. join(', ', array_map(function($term) { return join('/', $term[0]); }, $map)));
. implode(
', ',
array_map(function($term)
{
return implode('/', $term[0]);
}, $map)));
}
public function getRequirementForBasicToken(SearchToken $token)
@ -118,7 +123,7 @@ abstract class AbstractSearchParserConfig
protected function defineOrder($columnName, array $aliases)
{
$this->orderAliasMap []= [$aliases, $columnName];
$this->orderAliasMap[] = [$aliases, $columnName];
}
protected function defineBasicTokenParser($parser)
@ -135,7 +140,7 @@ abstract class AbstractSearchParserConfig
$item->columnName = $columnName;
$item->aliases = $aliases;
$item->flagsOrCallback = $flagsOrCallback;
$this->namedTokenParsers []= $item;
$this->namedTokenParsers[] = $item;
}
protected function defineSpecialTokenParser(
@ -145,7 +150,7 @@ abstract class AbstractSearchParserConfig
$item = new \StdClass;
$item->aliases = $aliases;
$item->callback = $callback;
$this->specialTokenParsers []= $item;
$this->specialTokenParsers[] = $item;
}
protected static function createRequirementValue(
@ -261,6 +266,11 @@ abstract class AbstractSearchParserConfig
throw new NotSupportedException(
'Unknown search key: ' . $key
. '. Possible search keys: '
. join(', ', array_map(function($item) { return join('/', $item->aliases); }, $parsers)));
. implode(
', ',
array_map(function($item)
{
return implode('/', $item->aliases);
}, $parsers)));
}
}

View file

@ -90,7 +90,7 @@ class SearchParser
if ($negated)
{
$orderDir = $orderDir == IFilter::ORDER_DESC
$orderDir = $orderDir === IFilter::ORDER_DESC
? IFilter::ORDER_ASC
: IFilter::ORDER_DESC;
}

View file

@ -106,7 +106,7 @@ class HistoryService
foreach ($base[$key] as $subValue)
{
if (!isset($other[$key]) || !in_array($subValue, $other[$key]))
$result[$key] []= $subValue;
$result[$key][] = $subValue;
}
if (empty($result[$key]))
unset($result[$key]);

View file

@ -110,11 +110,11 @@ class ImageConverter
private function convertWithPrograms($programs, $targetPath)
{
$any_program_available = false;
$anyProgramAvailable = false;
foreach ($programs as $program => $args)
$any_program_available |= ProgramExecutor::isProgramAvailable($program);
if (!$any_program_available)
throw new \Exception('No converter available (tried ' . join(', ', array_keys($programs)) . ')');
$anyProgramAvailable |= ProgramExecutor::isProgramAvailable($program);
if (!$anyProgramAvailable)
throw new \Exception('No converter available (tried ' . implode(', ', array_keys($programs)) . ')');
$errors = [];
foreach ($programs as $program => $args)
@ -127,7 +127,7 @@ class ImageConverter
}
}
throw new \Exception('Error while converting file to image: ' . join(', ', $errors));
throw new \Exception('Error while converting file to image: ' . implode(', ', $errors));
}
private function deleteIfExists($path)

View file

@ -7,7 +7,7 @@ class ImagickImageManipulator implements IImageManipulator
{
$image = new \Imagick();
$image->readImageBlob($source);
if ($image->getImageFormat() == 'GIF')
if ($image->getImageFormat() === 'GIF')
$image = $image->coalesceImages();
return $image;
}

View file

@ -22,7 +22,7 @@ class Upgrade34 implements IUpgrade
{
if (!is_array($target))
$target = [$target];
$target []= $item[1];
$target[] = $item[1];
}
else
{

View file

@ -41,7 +41,9 @@ class Upgrade38 implements IUpgrade
$post->setContentType(Post::POST_TYPE_ANIMATED_IMAGE);
$this->postDao->save($post);
}
if (++ $progress == 100)
$progress++;
if ($progress === 100)
{
echo '.';
$progress = 0;