Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 86ef687

Browse files
committed
Merging develop to master in preparation for 2.6.0
2 parents 1820f00 + c1e643d commit 86ef687

File tree

4 files changed

+52
-32
lines changed

4 files changed

+52
-32
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ matrix:
2323
- php: 7
2424
- php: hhvm
2525
allow_failures:
26-
- php: 7
2726
- php: hhvm
2827

2928
notifications:

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 2.6.0 - 2016-02-18
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Deprecated
12+
13+
- Nothing.
14+
15+
### Removed
16+
17+
- Nothing.
18+
19+
### Fixed
20+
21+
- [#47](https://github.com/zendframework/zend-mail/pull/47) updates the
22+
component to remove the (soft) dependency on zend-servicemanager, by
23+
altering the `SmtpPluginManager` to implement container-interop's
24+
`ContainerInterface` instead of extending from `AbstractPluginManager`.
25+
Usage remains the same, though developers who were adding services
26+
to the plugin manager will need to instead extend it now.
27+
- [#70](https://github.com/zendframework/zend-mail/pull/70) updates dependencies
28+
to stable, forwards-compatible versions, and removes unused dependencies.
29+
530
## 2.5.3 - TBD
631

732
### Added

composer.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,18 @@
1313
}
1414
},
1515
"require": {
16-
"php": ">=5.5",
17-
"zendframework/zend-crypt": "~2.5",
18-
"zendframework/zend-loader": "~2.5",
19-
"zendframework/zend-mime": "~2.5",
20-
"zendframework/zend-stdlib": "~2.5",
21-
"zendframework/zend-validator": "~2.5"
16+
"php": "^5.5 || ^7.0",
17+
"zendframework/zend-crypt": "^2.6",
18+
"zendframework/zend-loader": "^2.5",
19+
"zendframework/zend-mime": "^2.5",
20+
"zendframework/zend-stdlib": "^2.7 || ^3.0",
21+
"zendframework/zend-validator": "^2.6"
2222
},
2323
"require-dev": {
24-
"zendframework/zend-config": "~2.5",
25-
"zendframework/zend-servicemanager": "~2.5",
24+
"zendframework/zend-config": "^2.6",
2625
"fabpot/php-cs-fixer": "1.7.*",
2726
"phpunit/PHPUnit": "~4.0"
2827
},
29-
"suggest": {
30-
"zendframework/zend-servicemanager": "Zend\\ServiceManager component"
31-
},
3228
"minimum-stability": "dev",
3329
"prefer-stable": true,
3430
"extra": {

src/Protocol/SmtpPluginManager.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,48 @@
99

1010
namespace Zend\Mail\Protocol;
1111

12-
use Zend\ServiceManager\AbstractPluginManager;
12+
use Interop\Container\ContainerInterface;
1313

1414
/**
1515
* Plugin manager implementation for SMTP extensions.
1616
*
1717
* Enforces that SMTP extensions retrieved are instances of Smtp. Additionally,
1818
* it registers a number of default extensions available.
1919
*/
20-
class SmtpPluginManager extends AbstractPluginManager
20+
class SmtpPluginManager implements ContainerInterface
2121
{
2222
/**
23-
* Default set of extensions
23+
* Default set of plugins
2424
*
2525
* @var array
2626
*/
27-
protected $invokableClasses = [
27+
protected $plugins = [
2828
'crammd5' => 'Zend\Mail\Protocol\Smtp\Auth\Crammd5',
2929
'login' => 'Zend\Mail\Protocol\Smtp\Auth\Login',
3030
'plain' => 'Zend\Mail\Protocol\Smtp\Auth\Plain',
3131
'smtp' => 'Zend\Mail\Protocol\Smtp',
3232
];
3333

3434
/**
35-
* Validate the plugin
35+
* Do we have the plugin?
3636
*
37-
* Checks that the extension loaded is an instance of Smtp.
37+
* @param string $id
38+
* @return bool
39+
*/
40+
public function has($id)
41+
{
42+
return array_key_exists($id, $this->plugins);
43+
}
44+
/**
45+
* Retrieve the smtp plugin
3846
*
39-
* @param mixed $plugin
40-
* @return void
41-
* @throws Exception\InvalidArgumentException if invalid
47+
* @param string $id
48+
* @param array $options
49+
* @return AbstractProtocol
4250
*/
43-
public function validatePlugin($plugin)
51+
public function get($id, array $options = null)
4452
{
45-
if ($plugin instanceof Smtp) {
46-
// we're okay
47-
return;
48-
}
49-
50-
throw new Exception\InvalidArgumentException(sprintf(
51-
'Plugin of type %s is invalid; must extend %s\Smtp',
52-
(is_object($plugin) ? get_class($plugin) : gettype($plugin)),
53-
__NAMESPACE__
54-
));
53+
$class = $this->plugins[$id];
54+
return new $class($options);
5555
}
5656
}

0 commit comments

Comments
 (0)