attogram/shared-media-api

View on GitHub
src/Transport.php

Summary

Maintainability
A
1 hr
Test Coverage

Method send has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function send()
    {
        $this->logger->debug('Transport:send');
        if (!$this->hasParams()) {
            $this->logger->error('Transport::send: params Not Found');
Severity: Minor
Found in src/Transport.php - About 1 hr to fix

    Avoid assigning values to variables in if clauses and the like (line '144', column '14').
    Open

        private function decodeRequest()
        {
            $this->logger->debug('Transport:decodeRequest');
            if (($this->response = json_decode($this->request->getBody(), true))) {
                return true;
    Severity: Minor
    Found in src/Transport.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Property \Attogram\SharedMedia\Api\Transport->logger has undeclared type \Psr\Log\LoggerInterface
    Open

        public $logger;
    Severity: Minor
    Found in src/Transport.php by phan

    Return type of getClient() is undeclared type \GuzzleHttp\Client
    Open

        private function getClient()
    Severity: Minor
    Found in src/Transport.php by phan

    Property \Attogram\SharedMedia\Api\Transport->client has undeclared type \GuzzleHttp\Client
    Open

        private $client;
    Severity: Minor
    Found in src/Transport.php by phan

    Return type of getResponse() is undeclared type \GuzzleHttp\Psr7\Response
    Open

        protected function getResponse($keys = null)
    Severity: Minor
    Found in src/Transport.php by phan

    Property \Attogram\SharedMedia\Api\Transport->request has undeclared type \GuzzleHttp\Psr7\Request
    Open

        private $request;
    Severity: Minor
    Found in src/Transport.php by phan

    There are no issues that match your filters.

    Category
    Status