rspec/rules/S1784/flex/rule.adoc

41 lines
1.0 KiB
Plaintext

== Why is this an issue?
Access modifiers define which classes can access properties, variables, methods, and other classes. If an access modifier is not specified, the access level defaults to ``++internal++``, which grants access to all classes in the same package. This may be what is intended, but it should be specified explicitly to avoid confusion.
Available access modifiers are:
* ``++internal++`` - access allowed within the same package
* ``++private++`` - access allowed only within the same class
* ``++protected++`` - access allowed to the class and its child classes
* ``++public++`` - unfettered access by all
=== Noncompliant code example
[source,flex]
----
function checkResources():Boolean {
...
return true;
}
----
=== Compliant solution
[source,flex]
----
public function checkResources():Boolean {
...
return true;
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
endif::env-github,rspecator-view[]