Skip to content

Commit c5fd938

Browse files
committed
Renames configuration interfaces
1 parent 6372fb8 commit c5fd938

File tree

4 files changed

+64
-64
lines changed

4 files changed

+64
-64
lines changed

src/Configurable.php

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,24 @@
1212
namespace Http\Adapter;
1313

1414
/**
15-
* Allows global configurations
16-
*
17-
* This interface does not allow modifying options
15+
* Allows to modify configuration
1816
*
1917
* @author Márk Sági-Kazár [email protected]>
2018
*/
21-
interface Configurable
19+
interface Configurable extends HasConfiguration
2220
{
2321
/**
24-
* Returns an option by name
25-
*
26-
* @param string $name
27-
*
28-
* @return mixed
29-
*/
30-
public function getOption($name);
31-
32-
/**
33-
* Returns all options
34-
*
35-
* @return array
36-
*/
37-
public function getOptions();
38-
39-
/**
40-
* Checks if an option exists
22+
* Sets an option
4123
*
4224
* @param string $name
43-
*
44-
* @return boolean
25+
* @param mixed $option
4526
*/
46-
public function hasOption($name);
27+
public function setOption($name, $option);
4728

4829
/**
49-
* Checks if any option exists
30+
* Sets all options
5031
*
51-
* @return boolean
32+
* @param array $options
5233
*/
53-
public function hasOptions();
34+
public function setOptions(array $options);
5435
}

src/HasConfiguration.php

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
* This interface does not allow modifying options
18+
*
19+
* @author Márk Sági-Kazár [email protected]>
20+
*/
21+
interface HasConfiguration
22+
{
23+
/**
24+
* Returns an option by name
25+
*
26+
* @param string $name
27+
*
28+
* @return mixed
29+
*/
30+
public function getOption($name);
31+
32+
/**
33+
* Returns all options
34+
*
35+
* @return array
36+
*/
37+
public function getOptions();
38+
39+
/**
40+
* Checks if an option exists
41+
*
42+
* @param string $name
43+
*
44+
* @return boolean
45+
*/
46+
public function hasOption($name);
47+
48+
/**
49+
* Checks if any option exists
50+
*
51+
* @return boolean
52+
*/
53+
public function hasOptions();
54+
}

src/Message/ConfigurableRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
namespace Http\Adapter\Message;
1313

1414
use Psr\Http\Message\RequestInterface;
15-
use Psr\Http\Configurable;
15+
use Psr\Http\HasConfiguration;
1616

1717
/**
1818
* Allows to modify configuration in a request an immutable way
1919
*
2020
* @author Márk Sági-Kazár [email protected]>
2121
*/
22-
interface ConfigurableRequest extends RequestInterface, Configurable
22+
interface ConfigurableRequest extends RequestInterface, HasConfiguration
2323
{
2424
/**
2525
* Sets an option

src/MutableConfigurable.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)