According to the current version of PSR-19, PHPDoc is implicitly inherited, 
and even when PHPDoc is present in both the subclass and the superclass, 
tags that are present in the superclass' PHPDoc but not in the subclass' 
PHPDoc are inherited.

I think this is a very good idea, but I see a potential issue. Consider the 
following code.
interface FooInterface {
/**
* @throws RuntimeException If the operation fails.
*/
public function foo();
}

class FooImplementation implements FooInterface {
public function foo() {
// Do something that will never fail.
}
}

FooImplementation::foo() will never throw an exception, but FooInterface 
allows other implementations of FooInterface::foo() to throw exceptions. 
For someone depending on FooInterface, they will have to handle any thrown 
exceptions. For someone depending on FooImplementation, however, they do 
not have to care about FooImplementation::foo() throwing exceptions. But 
there seems to be no way to prevent FooImplementation::foo() from 
inheriting the @throws tag from FooInterface::foo().

Do we need a way to specify tags that should not be inherited?

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/95e9ee2b-7e5a-4d05-890b-00229ba0098b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to