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

Refactors theming app - part 4 #45146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fsamapoor
Copy link
Member

Summary

Following previous PRs taking advantage of PHP8's constructor property promotion, I have also made the required adjustments to the classes in the theming app.

I decided to split the changes into multiple PRs to make reviewing the changes easier.

The improvements in this PR include but are not limited to:

  • Using PHP8's constructor property promotion
  • Adding return types
  • Removing redundant docblocks

Checklist

@fsamapoor fsamapoor added 3. to review Waiting for reviews technical debt labels May 2, 2024
}

/**
* @param $app string app name
* @return string|false image blob
*/
public function getFavicon($app) {
public function getFavicon($app): bool|string {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $app has no provided type
@@ -102,7 +85,7 @@
* @param $app string app name
* @return string|false image blob
*/
public function getTouchIcon($app) {
public function getTouchIcon($app): bool|string {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $app has no provided type
@@ -125,7 +108,7 @@
* @param $size int size of the icon in px
* @return Imagick|false
*/
public function renderAppIcon($app, $size) {
public function renderAppIcon($app, $size): Imagick|bool {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $app has no provided type
@@ -125,7 +108,7 @@
* @param $size int size of the icon in px
* @return Imagick|false
*/
public function renderAppIcon($app, $size) {
public function renderAppIcon($app, $size): Imagick|bool {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $size has no provided type
@@ -227,7 +210,7 @@
* @param $image string relative path to svg file in app directory
* @return string|false content of a colorized svg file
*/
public function colorSvg($app, $image) {
public function colorSvg($app, $image): bool|string {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $app has no provided type
@@ -227,7 +210,7 @@
* @param $image string relative path to svg file in app directory
* @return string|false content of a colorized svg file
*/
public function colorSvg($app, $image) {
public function colorSvg($app, $image): bool|string {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $image has no provided type
public function getImprintUrl() {
return (string)$this->config->getAppValue('theming', 'imprintUrl', '');
public function getImprintUrl(): string {
return $this->config->getAppValue('theming', 'imprintUrl', '');

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
public function getPrivacyUrl() {
return (string)$this->config->getAppValue('theming', 'privacyUrl', '');
public function getPrivacyUrl(): string {
return $this->config->getAppValue('theming', 'privacyUrl', '');

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
public function getDocBaseUrl() {
return (string)$this->config->getAppValue('theming', 'docBaseUrl', $this->docBaseUrl);
public function getDocBaseUrl(): string {
return $this->config->getAppValue('theming', 'docBaseUrl', $this->docBaseUrl);

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
@@ -210,7 +192,7 @@
* @param $color
* @return string base64 encoded radio button svg
*/
public function generateRadioButton($color) {
public function generateRadioButton($color): string {

Check notice

Code scanning / Psalm

MissingParamType Note

Parameter $color has no provided type
… property promotion feature.

Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
@fsamapoor fsamapoor force-pushed the refactor_theming_app_part4 branch from e94860a to 407e780 Compare May 2, 2024 08:33
@fsamapoor fsamapoor requested review from a team, ArtificialOwl, icewind1991 and yemkareems and removed request for a team May 2, 2024 08:35
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

@solracsf solracsf added this to the Nextcloud 30 milestone Jun 18, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants