AbstractProcessor::encode()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php namespace Comodojo\RpcClient\Processor;
2
3
use \Comodojo\RpcClient\Interfaces\Processor as ProcessorInterface;
4
use \Comodojo\RpcClient\Traits\Encoding as EncodingTrait;
5
use \Psr\Log\LoggerInterface;
6
7
/**
8
 * @package     Comodojo Spare Parts
9
 * @author      Marco Giovinazzi <[email protected]>
10
 * @license     MIT
11
 *
12
 * LICENSE:
13
 *
14
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
 * THE SOFTWARE.
21
 */
22
23
abstract class AbstractProcessor implements ProcessorInterface {
24
25
    use EncodingTrait;
26
27
    protected $logger;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 63
    public function __construct($encoding, LoggerInterface $logger) {
33
34 63
        $this->setEncoding($encoding);
35
36 63
        $this->logger = $logger;
37
38 63
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    abstract public function encode(array $requests);
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    abstract public function decode($response);
49
50
}
51