Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hinting to public class #39

Merged
merged 2 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/Controller/WizardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Defaults;
use OCP\IConfig;
use OCP\IRequest;

Expand Down Expand Up @@ -63,7 +64,8 @@ public function disable() {
* @return TemplateResponse
*/
public function show() {
$theming = \OC::$server->getThemingDefaults();
/** @var Defaults $theming */
$theming = \OC::$server->query(Defaults::class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really get why we need to change this. I would like to avoid this. Because it basically means the API changed....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it does not. Because getThemingDefaults was never in OCP 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically only using the proper public interface instead of a private one from an app. (either returned OCA\Theming\ThemingDefaults or OC_Defaults).

return new TemplateResponse('firstrunwizard', 'wizard', [
'desktop' => $this->config->getSystemValue('customclient_desktop', $theming->getSyncClientUrl()),
'android' => $this->config->getSystemValue('customclient_android', $theming->getAndroidClientUrl()),
Expand Down
2 changes: 1 addition & 1 deletion templates/wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @var array $_
* @var \OCP\IL10N $l
* @var \OC_Defaults $theme
* @var \OCP\Defaults $theme
*/
?>
<div id="firstrunwizard">
Expand Down