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

Add Config Reader for Java-style .properties files and strings #4824

Merged
merged 14 commits into from
Jul 22, 2013
Merged

Add Config Reader for Java-style .properties files and strings #4824

merged 14 commits into from
Jul 22, 2013

Conversation

mvargeson
Copy link
Contributor

This pull request adds a Config Reader for Java-style .properties files and strings with corresponding tests.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 79b8276 on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

* @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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove @Package

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling d6deadf on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling d6deadf on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 0d98f17 on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.


namespace ZendTest\Config\Reader;

use Zend\Config\Reader\JavaProperties as JavaProperties;
Copy link
Member

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);
Copy link
Member

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.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling e139fe9 on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling e139fe9 on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0%) when pulling 88d5b03 on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0%) when pulling 88d5b03 on mvargeson:feature/config-reader-javaproperties into 40585a5 on zendframework:develop.

*
* @see ReaderInterface::fromString()
* @param string $string
* @return array|bool
Copy link
Contributor

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.

@ghost ghost assigned weierophinney Jul 22, 2013
weierophinney added a commit that referenced this pull request Jul 22, 2013
…perties

Add Config Reader for Java-style .properties files and strings
weierophinney added a commit that referenced this pull request Jul 22, 2013
@weierophinney weierophinney merged commit 0559ac0 into zendframework:develop Jul 22, 2013
}

// Check if ends with single '\' (indicating another line is expected)
if (strrpos($value, "\\") === strlen($value) - strlen("\\")) {
Copy link
Contributor

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?

Copy link
Member

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.

weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
…ature/config-reader-javaproperties

Add Config Reader for Java-style .properties files and strings
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants