Skip to content

Commit

Permalink
Format code to a single space around binary operators
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst authored and MorrisJobke committed Oct 5, 2020
1 parent d357f4b commit d9015a8
Show file tree
Hide file tree
Showing 335 changed files with 1,529 additions and 1,529 deletions.
6 changes: 3 additions & 3 deletions apps/accessibility/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@
'ocs' => [
[
'name' => 'Config#getConfig',
'url' => '/api/v1/config',
'url' => '/api/v1/config',
'verb' => 'GET',
],
[
'name' => 'Config#setConfig',
'url' => '/api/v1/config/{key}',
'url' => '/api/v1/config/{key}',
'verb' => 'PUT',
],
[
'name' => 'Config#deleteConfig',
'url' => '/api/v1/config/{key}',
'url' => '/api/v1/config/{key}',
'verb' => 'DELETE',
],
]
Expand Down
22 changes: 11 additions & 11 deletions apps/accessibility/lib/AccessibilityProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,41 @@ class AccessibilityProvider {
public function __construct(string $appName,
IURLGenerator $urlGenerator,
IL10N $l) {
$this->appName = $appName;
$this->appName = $appName;
$this->urlGenerator = $urlGenerator;
$this->l = $l;
$this->l = $l;
}

public function getThemes() {
return [
[
'id' => 'dark',
'img' => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'),
'id' => 'dark',
'img' => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'),
'title' => $this->l->t('Dark theme'),
'enableLabel' => $this->l->t('Enable dark theme'),
'text' => $this->l->t('A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find.')
'text' => $this->l->t('A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find.')
]
];
}

public function getHighContrast() {
return [
'id' => 'highcontrast',
'img' => $this->urlGenerator->imagePath($this->appName, 'mode-highcontrast.jpg'),
'id' => 'highcontrast',
'img' => $this->urlGenerator->imagePath($this->appName, 'mode-highcontrast.jpg'),
'title' => $this->l->t('High contrast mode'),
'enableLabel' => $this->l->t('Enable high contrast mode'),
'text' => $this->l->t('A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased.')
'text' => $this->l->t('A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased.')
];
}

public function getFonts() {
return [
[
'id' => 'fontdyslexic',
'img' => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'),
'id' => 'fontdyslexic',
'img' => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'),
'title' => $this->l->t('Dyslexia font'),
'enableLabel' => $this->l->t('Enable dyslexia font'),
'text' => $this->l->t('OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia.')
'text' => $this->l->t('OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia.')
]
];
}
Expand Down
30 changes: 15 additions & 15 deletions apps/accessibility/lib/Controller/AccessibilityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ public function __construct(string $appName,
IconsCacher $iconsCacher,
\OC_Defaults $defaults) {
parent::__construct($appName, $request);
$this->appName = $appName;
$this->config = $config;
$this->userManager = $userManager;
$this->logger = $logger;
$this->appName = $appName;
$this->config = $config;
$this->userManager = $userManager;
$this->logger = $logger;
$this->urlGenerator = $urlGenerator;
$this->timeFactory = $timeFactory;
$this->userSession = $userSession;
$this->appManager = $appManager;
$this->iconsCacher = $iconsCacher;
$this->defaults = $defaults;
$this->timeFactory = $timeFactory;
$this->userSession = $userSession;
$this->appManager = $appManager;
$this->iconsCacher = $iconsCacher;
$this->defaults = $defaults;

$this->serverRoot = \OC::$SERVERROOT;
$this->appRoot = $this->appManager->getAppPath($this->appName);
$this->appRoot = $this->appManager->getAppPath($this->appName);
}

/**
Expand All @@ -136,8 +136,8 @@ public function __construct(string $appName,
* @return DataDisplayResponse
*/
public function getCss(): DataDisplayResponse {
$css = '';
$imports = '';
$css = '';
$imports = '';
if ($this->userSession->isLoggedIn()) {
$userValues = $this->getUserValues();
} else {
Expand Down Expand Up @@ -182,7 +182,7 @@ public function getCss(): DataDisplayResponse {

// Rebase all urls
$appWebRoot = substr($this->appRoot, strlen($this->serverRoot) - strlen(\OC::$WEBROOT));
$css = $this->rebaseUrls($css, $appWebRoot . '/css');
$css = $this->rebaseUrls($css, $appWebRoot . '/css');

if (in_array('dark', $userValues) && $this->iconsCacher->getCachedList() && $this->iconsCacher->getCachedList()->getSize() > 0) {
$iconsCss = $this->invertSvgIconsColor($this->iconsCacher->getCachedList()->getContent());
Expand Down Expand Up @@ -215,7 +215,7 @@ public function getCss(): DataDisplayResponse {
*/
private function getUserValues(): array {
$userTheme = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false);
$userFont = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false);
$userFont = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false);
$userHighContrast = $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'highcontrast', false);

return [$userTheme, $userHighContrast, $userFont];
Expand All @@ -240,7 +240,7 @@ private function filterOutRule(string $rule, string $css): string {
* @return string
*/
private function rebaseUrls(string $css, string $webDir): string {
$re = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x';
$re = '/url\([\'"]([^\/][\.\w?=\/-]*)[\'"]\)/x';
$subst = 'url(\'' . $webDir . '/$1\')';

return preg_replace($re, $subst, $css);
Expand Down
10 changes: 5 additions & 5 deletions apps/accessibility/lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public function __construct(string $appName,
IUserSession $userSession,
AccessibilityProvider $accessibilityProvider) {
parent::__construct($appName, $request);
$this->appName = $appName;
$this->config = $config;
$this->userSession = $userSession;
$this->appName = $appName;
$this->config = $config;
$this->userSession = $userSession;
$this->accessibilityProvider = $accessibilityProvider;
$this->userId = $userSession->getUser()->getUID();
$this->userId = $userSession->getUser()->getUID();
}

/**
Expand Down Expand Up @@ -115,7 +115,7 @@ public function setConfig(string $key, $value): DataResponse {

$themes = $this->accessibilityProvider->getThemes();
$highcontrast = [$this->accessibilityProvider->getHighContrast()];
$fonts = $this->accessibilityProvider->getFonts();
$fonts = $this->accessibilityProvider->getFonts();

$availableOptions = array_map(function ($option) {
return $option['id'];
Expand Down
18 changes: 9 additions & 9 deletions apps/accessibility/lib/Settings/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public function __construct(string $appName,
IURLGenerator $urlGenerator,
AccessibilityProvider $accessibilityProvider,
IInitialStateService $initialStateService) {
$this->appName = $appName;
$this->config = $config;
$this->userSession = $userSession;
$this->l = $l;
$this->urlGenerator = $urlGenerator;
$this->appName = $appName;
$this->config = $config;
$this->userSession = $userSession;
$this->l = $l;
$this->urlGenerator = $urlGenerator;
$this->accessibilityProvider = $accessibilityProvider;
$this->initialStateService = $initialStateService;
$this->initialStateService = $initialStateService;
}

/**
Expand All @@ -93,14 +93,14 @@ public function getForm() {

$availableConfig = [
'themes' => $this->accessibilityProvider->getThemes(),
'fonts' => $this->accessibilityProvider->getFonts(),
'fonts' => $this->accessibilityProvider->getFonts(),
'highcontrast' => $this->accessibilityProvider->getHighContrast()
];

$userConfig = [
'highcontrast' => $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'highcontrast', false),
'theme' => $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false),
'font' => $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false)
'theme' => $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'theme', false),
'font' => $this->config->getUserValue($this->userSession->getUser()->getUID(), $this->appName, 'font', false)
];

$this->initialStateService->provideInitialState($this->appName, 'available-config', $availableConfig);
Expand Down
4 changes: 2 additions & 2 deletions apps/accessibility/lib/Settings/PersonalSection.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class PersonalSection implements IIconSection {
public function __construct(string $appName,
IURLGenerator $urlGenerator,
IL10N $l) {
$this->appName = $appName;
$this->appName = $appName;
$this->urlGenerator = $urlGenerator;
$this->l = $l;
$this->l = $l;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/admin_audit/lib/BackgroundJobs/Rotate.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Rotate extends TimedJob {
use RotationTrait;

public function __construct() {
$this->setInterval(60*60*3);
$this->setInterval(60 * 60 * 3);
}

protected function run($argument) {
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/lib/EventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EventHandler implements ICommentsEventHandler {
private $notificationListener;

public function __construct(ActivityListener $activityListener, NotificationListener $notificationListener) {
$this->activityListener = $activityListener;
$this->activityListener = $activityListener;
$this->notificationListener = $notificationListener;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testSort($data) {
$commentMocks = [];
foreach ($data['actors'] as $actorType => $actors) {
foreach ($actors as $actorId => $noOfComments) {
for ($i=0;$i<$noOfComments;$i++) {
for ($i = 0;$i < $noOfComments;$i++) {
$mock = $this->createMock(IComment::class);
$mock->expects($this->atLeastOnce())
->method('getActorType')
Expand Down
4 changes: 2 additions & 2 deletions apps/dav/lib/BackgroundJob/CleanupDirectLinksJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ class CleanupDirectLinksJob extends TimedJob {
private $mapper;

public function __construct(ITimeFactory $timeFactory, DirectMapper $mapper) {
$this->setInterval(60*60*24);
$this->setInterval(60 * 60 * 24);

$this->timeFactory = $timeFactory;
$this->mapper = $mapper;
}

protected function run($argument) {
// Delete all shares expired 24 hours ago
$this->mapper->deleteExpired($this->timeFactory->getTime() - 60*60*24);
$this->mapper->deleteExpired($this->timeFactory->getTime() - 60 * 60 * 24);
}
}
4 changes: 2 additions & 2 deletions apps/dav/lib/BackgroundJob/UploadCleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(ITimeFactory $time, IRootFolder $rootFolder, IJobLis
$this->jobList = $jobList;

// Run once a day
$this->setInterval(60*60*24);
$this->setInterval(60 * 60 * 24);
}

protected function run($argument) {
Expand All @@ -65,7 +65,7 @@ protected function run($argument) {
$uploads = $userRoot->get('uploads');
/** @var Folder $uploadFolder */
$uploadFolder = $uploads->get($folder);
} catch (NotFoundException|NoUserException $e) {
} catch (NotFoundException | NoUserException $e) {
$this->jobList->remove(self::class, $argument);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/dav/lib/CalDAV/BirthdayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function ensureCalendarExists(string $principal):?array {
$this->calDavBackEnd->createCalendar($principal, self::BIRTHDAY_CALENDAR_URI, [
'{DAV:}displayname' => 'Contact birthdays',
'{http://apple.com/ns/ical/}calendar-color' => '#E9D859',
'components' => 'VEVENT',
'components' => 'VEVENT',
]);

return $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
Expand Down Expand Up @@ -427,8 +427,8 @@ private function isUserEnabled(string $userPrincipal):bool {
*/
private function formatTitle(string $field,
string $name,
int $year=null,
bool $supports4Byte=true):string {
int $year = null,
bool $supports4Byte = true):string {
if ($supports4Byte) {
switch ($field) {
case 'BDAY':
Expand Down
Loading

0 comments on commit d9015a8

Please sign in to comment.