ampache/ampache

View on GitHub
src/Repository/Model/User_Playlist.php

Summary

Maintainability
A
35 mins
Test Coverage

Method set_items has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function set_items($playlist, $current_type, $current_id, $current_time, $time): void
Severity: Minor
Found in src/Repository/Model/User_Playlist.php - About 35 mins to fix

    syntax error, unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
    Open

        public int $user;
    Severity: Critical
    Found in src/Repository/Model/User_Playlist.php by phan

    The parameter $object_type is not named in camelCase.
    Open

        public function set_current_object($object_type, $object_id, $position): void
        {
            // remove the old current
            $sql = "UPDATE `user_playlist` SET `current_track` = 0, `current_time` = 0 WHERE `user` = ?";
            Dba::write($sql, array($this->user));

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $current_type is not named in camelCase.
    Open

        public function set_items($playlist, $current_type, $current_id, $current_time, $time): void
        {
            if (!empty($playlist)) {
                // clear the old list
                $this->clear();

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The class User_Playlist is not named in CamelCase.
    Open

    class User_Playlist extends database_object
    {
        protected const DB_TABLENAME = 'user_playlist';
    
        public int $user;

    CamelCaseClassName

    Since: 0.2

    It is considered best practice to use the CamelCase notation to name classes.

    Example

    class class_name {
    }

    Source

    The parameter $current_time is not named in camelCase.
    Open

        public function set_items($playlist, $current_type, $current_id, $current_time, $time): void
        {
            if (!empty($playlist)) {
                // clear the old list
                $this->clear();

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $object_id is not named in camelCase.
    Open

        public function set_current_object($object_type, $object_id, $position): void
        {
            // remove the old current
            $sql = "UPDATE `user_playlist` SET `current_track` = 0, `current_time` = 0 WHERE `user` = ?";
            Dba::write($sql, array($this->user));

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $object_type is not named in camelCase.
    Open

        public function set_current_id($object_type, $track, $position): void
        {
            // remove the old current
            $sql = "UPDATE `user_playlist` SET `current_track` = 0, `current_time` = 0 WHERE `user` = ?";
            Dba::write($sql, array($this->user));

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $user_id is not named in camelCase.
    Open

        public function __construct($user_id = 0, $client = null)
        {
            if (!$user_id) {
                return;
            }

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $current_id is not named in camelCase.
    Open

        public function set_items($playlist, $current_type, $current_id, $current_time, $time): void
        {
            if (!empty($playlist)) {
                // clear the old list
                $this->clear();

    CamelCaseParameterName

    Since: 0.2

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

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    Class name "User_Playlist" is not in camel caps format
    Open

    class User_Playlist extends database_object

    There are no issues that match your filters.

    Category
    Status