Skip to content

Commit 19aca0d

Browse files
committed
Adds Configurable interface
1 parent 565d880 commit 19aca0d

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

src/Configurable.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Http Adapter package.
5+
*
6+
* (c) Eric GELOEN <[email protected]>
7+
*
8+
* For the full copyright and license information, please read the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Http\Adapter;
13+
14+
/**
15+
* Allows global configurations
16+
*
17+
* @author Márk Sági-Kazár [email protected]>
18+
*/
19+
interface Configurable
20+
{
21+
/**
22+
* Returns a sepcific option or null
23+
*
24+
* @param string $name
25+
*
26+
* @return mixed
27+
*/
28+
public function getOption($name);
29+
30+
/**
31+
* Returns all options
32+
*
33+
* @return array
34+
*/
35+
public function getOptions();
36+
37+
/**
38+
* Checks if an option is set
39+
*
40+
* @param string $name
41+
*
42+
* @return boolean
43+
*/
44+
public function hasOption($name);
45+
46+
/**
47+
* Sets an option
48+
*
49+
* @param string $name
50+
* @param mixed $option
51+
*/
52+
public function setOption($name, $option);
53+
54+
/**
55+
* Sets all options
56+
*
57+
* @param array $options
58+
*/
59+
public function setOptions($options);
60+
}

src/ConfigurableHttpAdapter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Psr\Http\Message\ResponseInterface;
1717

1818
/**
19+
* Allows request level configurations
20+
*
1921
* @author Márk Sági-Kazár [email protected]>
2022
*/
2123
interface ConfigurableHttpAdapter extends HttpAdapter

0 commit comments

Comments
 (0)