rspec/rules/S1467/flex/rule.adoc

14 lines
300 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
A listener can be attached to an object only after it has been constructed. So dispatching an event in a constructor is useless and error prone.
== Noncompliant Code Example
----
public class MyClass
{
public function MyClass()
{
dispatchEvent( new Event( "uselessEvent" ) );
}
}
----