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

Commit

Permalink
Merge pull request #19 from webimpress/feature/class-name-scalars
Browse files Browse the repository at this point in the history
New configuration option: class_name_scalars
  • Loading branch information
weierophinney committed Aug 13, 2016
2 parents 6c84f55 + 69cbbf2 commit f025815
Show file tree
Hide file tree
Showing 14 changed files with 369 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
vendor/
phpunit.xml
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ The top-level configuration key for user configuration of this module is `zf-con
'zf-configuration' => [
'config_file' => 'config/autoload/development.php',
'enable_short_array' => false,
'class_name_scalars' => false,
],
```

Expand All @@ -71,6 +72,10 @@ The top-level configuration key for user configuration of this module is `zf-con
Set this value to a boolean `true` if you want to use PHP 5.4's square bracket (aka "short") array
syntax.

#### Key: `class_name_scalars`

Set this value to a boolean `true` if you want to use PHP 5.5's class name scalars (`::class` notation).

ZF2 Events
----------

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
"zendframework/zend-stdlib": "^2.7.7 || ^3.0.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8 || ^5.0",
"squizlabs/php_codesniffer": "^2.3.1"
"phpunit/phpunit": "^4.8 || ^5.5",
"squizlabs/php_codesniffer": "^2.6.2",
"zendframework/zend-servicemanager": "^2.7.6 || ^3.1.1"
},
"autoload": {
"psr-4": {
Expand Down
149 changes: 116 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@
return [
'zf-configuration' => [
'config_file' => 'config/autoload/development.php',
/* set the following flag if you wish to use short array syntax
* in configuration files manipulated by the ConfigWriter:
*
* 'enable_short_array' => true,
*/
// set the following flag if you wish to use short array syntax
// in configuration files manipulated by the ConfigWriter:
// 'enable_short_array' => true,

// class_name_scalars defines whether configuration files
// manipulated by the ConfigWriter should use ::class notation
// 'class_name_scalars' => true,
],
'service_manager' => [
'factories' => [
ConfigResource::class => Factory\ConfigResourceFactory::class,
ConfigResourceFactory::class => Factory\ResourceFactoryFactory::class,
ConfigWriter::class => Factory\ConfigWriterFactory::class,
ModuleUtils::class => Factory\ModuleUtilsFactory::class,
]
],
],
];
6 changes: 6 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<!-- inherit rules from: -->
<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0"?>
<phpunit bootstrap="./vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="ZFConfiguration Module Tests">
Expand Down
Loading

0 comments on commit f025815

Please sign in to comment.