-
Notifications
You must be signed in to change notification settings - Fork 19
[BUG] An alias "filerename" was requested but no service could be found ZF2.5.3 #14
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,12 @@ | |
"zendframework/zend-stdlib": "~2.5" | ||
}, | ||
"require-dev": { | ||
"zendframework/zend-filter": "~2.5", | ||
"zendframework/zend-filter": "~2.6", | ||
"zendframework/zend-i18n": "~2.5", | ||
"zendframework/zend-servicemanager": "~2.5", | ||
"zendframework/zend-validator": "~2.5", | ||
"zendframework/zend-progressbar": "~2.5", | ||
"zendframework/zend-session": "~2.5", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed? In which case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I cannot find a requirement for this anywhere. |
||
"fabpot/php-cs-fixer": "1.7.*", | ||
"phpunit/PHPUnit": "~4.0" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
namespace Zend\File\Transfer\Adapter; | ||
|
||
use Zend\Filter\FilterPluginManager as BaseManager; | ||
use Zend\Filter\File; | ||
|
||
/** | ||
* Plugin manager implementation for the filter chain. | ||
|
@@ -20,16 +21,19 @@ | |
*/ | ||
class FilterPluginManager extends BaseManager | ||
{ | ||
/** | ||
* Default set of filters | ||
* | ||
* @var array | ||
*/ | ||
protected $aliases = [ | ||
'decrypt' => 'filedecrypt', | ||
'encrypt' => 'fileencrypt', | ||
'lowercase' => 'filelowercase', | ||
'rename' => 'filerename', | ||
'uppercase' => 'fileuppercase', | ||
]; | ||
|
||
public function __construct($configOrContainerInstance = null, array $v3config = []) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Constructor needs documentation docblock There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ocramius that's the naming current under zend-servicemanager; in v3, it's a configuration array; v2 doesn't accept a second argument. Hence, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@weierophinney that's ok, didn't know :-) |
||
{ | ||
parent::__construct($configOrContainerInstance, $v3config); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a BC break There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ocramius yes and no. Prior to zend-filter 2.6.0, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still a BC break from a consumer of this library perspective though :-\ |
||
$this->aliases = array_merge(array( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use the short array syntax. Remember that multi-line parameters should stay on a line of their own as per PSR-7 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ocramius wants to say PSR-2 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Long night :P |
||
'decrypt' => File\Decrypt::class, | ||
'encrypt' => File\Encrypt::class, | ||
'lowercase' => File\LowerCase::class, | ||
'rename' => File\Rename::class, | ||
'uppercase' => File\UpperCase::class | ||
), $this->aliases); | ||
} | ||
|
||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,7 +301,7 @@ public function testGetFilterShouldReturnNullWhenNoMatchingIdentifierExists() | |
|
||
public function testAdapterShouldAllowPullingFiltersByFile() | ||
{ | ||
$this->adapter->addFilter('Boolean', 1, 'foo'); | ||
$this->adapter->addFilter('Boolean', [1], 'foo'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like a BC break There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On investigation, this is due to how "creation options" are handled in v2 with the invokable factory. I think there may be a way to work around it; testing something now. |
||
$filters = $this->adapter->getFilters('foo'); | ||
$this->assertEquals(1, count($filters)); | ||
$filter = array_shift($filters); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
*/ | ||
class HttpTestMockAdapter extends Adapter\Http | ||
{ | ||
static $aa = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this be given a better name? |
||
|
||
public function __construct() | ||
{ | ||
self::$callbackApc = ['ZendTest\File\Transfer\Adapter\HttpTestMockAdapter', 'apcTest']; | ||
|
@@ -36,7 +38,7 @@ public function isValidParent($files = null) | |
|
||
public static function isApcAvailable() | ||
{ | ||
return true; | ||
return static::$aa; | ||
} | ||
|
||
public static function apcTest($id) | ||
|
@@ -50,7 +52,7 @@ public static function uPTest($id) | |
} | ||
|
||
public function switchApcToUP() | ||
{ | ||
{ static::$aa = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be on a new line. Also: why is this change required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've pulled the changes in locally, and none of the changes to this particular class are necessary; tests pass with and without them. |
||
self::$callbackApc = null; | ||
self::$callbackUploadProgress = ['ZendTest\File\Transfer\Adapter\HttpTestMockAdapter', 'uPTest']; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed? In which case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, in
ZendTest\File\Transfer\Adatper\HttpTest
. Missing requirement, evidently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and that test requires it in order to test
Zend\File\Transfer\Adapter\Http
)