Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Feb 11, 2020

Fix #19404

Actually PHPStorm did most of the work ;)

I need some advice regarding: https://github.com/nextcloud/server/pull/19412/files#diff-285a829dbb3541adc9e8ee65266f70aeR188 PHPStorm replaced self::TAG_FAVORITE with ITags::TAG_FAVORITE in OC\Tags. OC\Tags implements ITags hence the constants are available. Is self::CONSTANT_NAME some kind of anti pattern?

@kesselb kesselb added 2. developing Work in progress enhancement 3. to review Waiting for reviews and removed 2. developing Work in progress labels Feb 11, 2020
@kesselb kesselb added this to the Nextcloud 19 milestone Feb 12, 2020
@ChristophWurst
Copy link
Member

I need some advice regarding: https://github.com/nextcloud/server/pull/19412/files#diff-285a829dbb3541adc9e8ee65266f70aeR188 PHPStorm replaced self::TAG_FAVORITE with ITags::TAG_FAVORITE in OC\Tags. OC\Tags implements ITags hence the constants are available.

I'm a bit surprised constants are inherited as they are static properties of a class. But apparently PHP will allow you to access them via self on children. StackOverflow says you can even overwrite them 😮

Let's use ITags::.. :)

Signed-off-by: Daniel Kesselberg <[email protected]>
@kesselb kesselb force-pushed the fix/19404/make-favorite-public branch from 768f68a to 6235175 Compare February 12, 2020 14:12
@kesselb
Copy link
Contributor Author

kesselb commented Feb 12, 2020

Fine by me.

@juliusknorr juliusknorr added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Feb 14, 2020
@ChristophWurst ChristophWurst merged commit dd9d469 into master Feb 21, 2020
@ChristophWurst ChristophWurst deleted the fix/19404/make-favorite-public branch February 21, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OC\Tags::TAG_FAVORITE is not public

4 participants