GemsTracker/gemstracker-library

View on GitHub
classes/Gems/Translate/GenderTranslation.php

Summary

Maintainability
A
0 mins
Test Coverage
F
55%

Avoid unused parameters such as '$singular'.
Open

    public function plural($singular, $plural, $number, $locale = null)

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

    public function plural($singular, $plural, $number, $locale = null)

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

    public function plural($singular, $plural, $number, $locale = null)

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

    public function plural($singular, $plural, $number, $locale = null)

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

    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)) {

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

    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)) {

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status