classes/Gems/Translate/GenderTranslation.php
Avoid unused parameters such as '$singular'. Open
Open
public function plural($singular, $plural, $number, $locale = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$plural'. Open
Open
public function plural($singular, $plural, $number, $locale = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$locale'. Open
Open
public function plural($singular, $plural, $number, $locale = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$number'. Open
Open
public function plural($singular, $plural, $number, $locale = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid using short method names like GenderTranslation::_(). The configured minimum method name length is 3. Open
Open
public function _($text, $locale = null, $gender = null)
{
if ($gender && isset($this->genderTranslates[$gender])) {
$adapter = $this->genderTranslates[$gender]->getAdapter();
if ($adapter instanceof \Zend_Translate_Adapter && $adapter->isTranslated($text, false, $locale)) {
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
The method _ is not named in camelCase. Open
Open
public function _($text, $locale = null, $gender = null)
{
if ($gender && isset($this->genderTranslates[$gender])) {
$adapter = $this->genderTranslates[$gender]->getAdapter();
if ($adapter instanceof \Zend_Translate_Adapter && $adapter->isTranslated($text, false, $locale)) {
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}