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 --> <!-- 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) --> <!-- Check the position of the open curly brace in a control structure (if) -->
<!-- sl = same line --> <!-- sl = same line -->
<!-- nl = new line --> <!-- nl = new line -->

View file

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

View file

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

View file

@ -39,7 +39,7 @@ class HttpHelper
$result = []; $result = [];
foreach ($_SERVER as $key => $value) 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))))); $key = str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($key, 5)))));
$result[$key] = $value; $result[$key] = $value;

View file

@ -33,7 +33,12 @@ abstract class AbstractSearchParserConfig
throw new NotSupportedException('Unknown order term: ' . $tokenValue throw new NotSupportedException('Unknown order term: ' . $tokenValue
. '. Possible order terms: ' . '. 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) public function getRequirementForBasicToken(SearchToken $token)
@ -118,7 +123,7 @@ abstract class AbstractSearchParserConfig
protected function defineOrder($columnName, array $aliases) protected function defineOrder($columnName, array $aliases)
{ {
$this->orderAliasMap []= [$aliases, $columnName]; $this->orderAliasMap[] = [$aliases, $columnName];
} }
protected function defineBasicTokenParser($parser) protected function defineBasicTokenParser($parser)
@ -135,7 +140,7 @@ abstract class AbstractSearchParserConfig
$item->columnName = $columnName; $item->columnName = $columnName;
$item->aliases = $aliases; $item->aliases = $aliases;
$item->flagsOrCallback = $flagsOrCallback; $item->flagsOrCallback = $flagsOrCallback;
$this->namedTokenParsers []= $item; $this->namedTokenParsers[] = $item;
} }
protected function defineSpecialTokenParser( protected function defineSpecialTokenParser(
@ -145,7 +150,7 @@ abstract class AbstractSearchParserConfig
$item = new \StdClass; $item = new \StdClass;
$item->aliases = $aliases; $item->aliases = $aliases;
$item->callback = $callback; $item->callback = $callback;
$this->specialTokenParsers []= $item; $this->specialTokenParsers[] = $item;
} }
protected static function createRequirementValue( protected static function createRequirementValue(
@ -261,6 +266,11 @@ abstract class AbstractSearchParserConfig
throw new NotSupportedException( throw new NotSupportedException(
'Unknown search key: ' . $key 'Unknown search key: ' . $key
. '. Possible search keys: ' . '. 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) if ($negated)
{ {
$orderDir = $orderDir == IFilter::ORDER_DESC $orderDir = $orderDir === IFilter::ORDER_DESC
? IFilter::ORDER_ASC ? IFilter::ORDER_ASC
: IFilter::ORDER_DESC; : IFilter::ORDER_DESC;
} }

View file

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

View file

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

View file

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

View file

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

View file

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