-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add Config Reader for Java-style .properties files and strings #4824
Add Config Reader for Java-style .properties files and strings #4824
Conversation
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Config |
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.
remove @Package
1 similar comment
|
||
namespace ZendTest\Config\Reader; | ||
|
||
use Zend\Config\Reader\JavaProperties as JavaProperties; |
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.
Alias not required.
|
||
// Check if ends with single '\' (indicating another line is expected) | ||
if (strrpos($value, "\\") === strlen($value)-strlen("\\")) { | ||
$value = substr($value,0,strlen($value)-1); |
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.
Spaces after comma and before and after minus.
1 similar comment
* | ||
* @see ReaderInterface::fromString() | ||
* @param string $string | ||
* @return array|bool |
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.
While reading this code, it seems to me that this ::fromString()
method never returns a boolean. Therefore I would suggest removing that hint. I would also suggest adding an @throws
line, since the ::process()
method can throw an exception.
…perties Add Config Reader for Java-style .properties files and strings
} | ||
|
||
// Check if ends with single '\' (indicating another line is expected) | ||
if (strrpos($value, "\\") === strlen($value) - strlen("\\")) { |
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.
Maybe it's better to get strlen("\\")
out of the cycle?
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.
Like, replacing it with 1
? I agree.
…ature/config-reader-javaproperties Add Config Reader for Java-style .properties files and strings
This pull request adds a Config Reader for Java-style .properties files and strings with corresponding tests.