src/Api/Providers/Pinners.php
The class Pinners has 11 public methods. Consider refactoring Pinners to keep number of public methods under 10. Open
Open
class Pinners extends FollowableProvider
{
use Searchable, ResolvesCurrentUser;
/**
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Avoid using static access to class '\seregazhuk\PinterestBot\Helpers\UrlBuilder' in method 'following'. Open
Open
$followingUrl = UrlBuilder::getFollowingUrlByType($type);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Only one argument is allowed per line in a multi-line function call Open
Open
$username, UrlBuilder::RESOURCE_USER_PINS, $limit
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
$username, UrlBuilder::RESOURCE_USER_LIKES, $limit
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
UrlBuilder::RESOURCE_BLOCK_USER, ['blocked_user_id' => $userId]
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
$username, UrlBuilder::RESOURCE_USER_PINS, $limit
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
Open
$username, UrlBuilder::RESOURCE_USER_LIKES, $limit
- Exclude checks