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

Commit 7887c6c

Browse files
committed
Merge branch 'hotfix/377'
Close #377
2 parents 625e7c5 + 1885e1b commit 7887c6c

File tree

5 files changed

+73
-4
lines changed

5 files changed

+73
-4
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ $ composer create-project -sdev zendframework/skeleton-application path/to/insta
2121
Once installed, you can test it out immediately using PHP's built-in web server:
2222

2323
```bash
24+
$ cd path/to/install
2425
$ php -S 0.0.0.0:8080 -t public/ public/index.php
26+
# OR use the composer alias:
27+
$ composer serve
2528
```
2629

2730
This will start the cli-server on port 8080, and bind it to all network
28-
interfaces.
31+
interfaces. You can then visit the site at http://localhost:8080/
32+
- which will bring up Zend Framework welcome page.
2933

3034
**Note:** The built-in CLI server is *for development only*.
3135

@@ -184,3 +188,31 @@ server {
184188
```
185189

186190
Restart the nginx, now you should be ready to go!
191+
192+
## QA Tools
193+
194+
The skeleton does not come with any QA tooling by default, but does ship with
195+
configuration for each of:
196+
197+
- [phpcs](https://github.com/squizlabs/php_codesniffer)
198+
- [phpunit](https://phpunit.de)
199+
200+
Additionally, it comes with some basic tests for the shipped
201+
`Application\Controller\IndexController`.
202+
203+
If you want to add these QA tools, execute the following:
204+
205+
```bash
206+
$ composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test
207+
```
208+
209+
We provide aliases for each of these tools in the Composer configuration:
210+
211+
```bash
212+
# Run CS checks:
213+
$ composer cs-check
214+
# Fix CS errors:
215+
$ composer cs-fix
216+
# Run PHPUnit tests:
217+
$ composer test
218+
```

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@
110110
]
111111
},
112112
"scripts": {
113+
"cs-check": "phpcs",
114+
"cs-fix": "phpcbf",
113115
"development-disable": "zf-development-mode disable",
114116
"development-enable": "zf-development-mode enable",
115117
"development-status": "zf-development-mode status",
116-
"serve": "php -S 0.0.0.0:8080 -t public/ public/index.php"
118+
"serve": "php -S 0.0.0.0:8080 -t public/ public/index.php",
119+
"test": "phpunit"
117120
}
118121
}

module/Application/view/error/404.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
<?php endif ?>
4343

4444
<?php if (! empty($this->display_exceptions)) : ?>
45-
<?php if (isset($this->exception) && ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?>
45+
<?php if (isset($this->exception)
46+
&& ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?>
4647
<hr/>
4748

4849
<h2>Additional information:</h2>

module/Application/view/error/index.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<h2><?= $this->message ?></h2>
33

44
<?php if (! empty($this->display_exceptions)) : ?>
5-
<?php if (isset($this->exception) && ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?>
5+
<?php if (isset($this->exception)
6+
&& ($this->exception instanceof \Exception || $this->exception instanceof \Error)) : ?>
67
<hr/>
78

89
<h2>Additional information:</h2>

phpcs.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Zend Framework coding standard">
3+
<description>Zend Framework coding standard</description>
4+
5+
<!-- display progress -->
6+
<arg value="p"/>
7+
<arg name="colors"/>
8+
<arg name="extensions" value="php,dist,phtml"/>
9+
10+
<!-- inherit rules from: -->
11+
<rule ref="PSR2"/>
12+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
13+
<rule ref="Generic.Formatting.SpaceAfterNot"/>
14+
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
15+
<properties>
16+
<property name="ignoreNewlines" value="true"/>
17+
</properties>
18+
</rule>
19+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
20+
<properties>
21+
<property name="ignoreBlankLines" value="false"/>
22+
</properties>
23+
</rule>
24+
<rule ref="PSR1.Files.SideEffects">
25+
<exclude-pattern>public/index.php</exclude-pattern>
26+
</rule>
27+
28+
<!-- Paths to check -->
29+
<file>config</file>
30+
<file>module</file>
31+
<file>public/index.php</file>
32+
</ruleset>

0 commit comments

Comments
 (0)