Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ofbeaton committed Aug 7, 2015
1 parent 9a68389 commit c7fae7d
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 84 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
/vendor
/composer.phar
/.idea
/build
/logs
/phpcs.xml
56 changes: 56 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="CommandRunning" default="all">

<target name="install">
<exec command="COMPOSER_PROCESS_TIMEOUT=4000 HTTP_PROXY_REQUEST_FULLURI=0 HTTPS_PROXY_REQUEST_FULLURI=0 php composer.phar install --prefer-dist" passthru="true"/>
</target>

<target name="update">
<exec command="COMPOSER_PROCESS_TIMEOUT=4000 HTTP_PROXY_REQUEST_FULLURI=0 HTTPS_PROXY_REQUEST_FULLURI=0 php composer.phar update --prefer-dist" passthru="true"/>
</target>

<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer">
<exec executable="bin/phpcs" passthru="true">
</exec>
<exec executable="bin/phpcs" passthru="true">
<arg value="--report=checkstyle" />
<arg value="--report-file=logs/checkstyle.xml" />
</exec>
</target>

<target name="phpcbf" description="Code fixer using PHP_CodeSniffer">
<exec executable="bin/phpcbf" passthru="true">
<arg value="--no-patch" />
</exec>
</target>

<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="bin/phpcb" passthru="true">
<arg value="--log" /><arg path="logs" />
<arg value="--source" /><arg path="src" />
<arg value="--source" /><arg path="tests" />
<arg value="--output" /><arg path="build/browser" />
</exec>
</target>

<target name="clean" description="Remove temporary directories">
<delete dir="logs" />
<delete dir="build" />
<mkdir dir="logs" />
<mkdir dir="build" />
</target>

<target name="dist" description="Creates local copies of dist files">
<copy file="phpcs.xml.dist" tofile="phpcs.xml" />
</target>

<target name="checkstyle" depends="clean,phpcs,phpcb" />

<target name="fixstyle" depends="phpcbf" />

<target name="setup" depends="clean,dist" />

<target name="all" depends="clean,phpcbf,phpcs,phpcb" />

</project>
20 changes: 10 additions & 10 deletions composer.lock

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

11 changes: 11 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<ruleset name="cmdlineargs">
<description>The default command line arguments</description>

<file>src</file>
<file>tests</file>

<arg name="extensions" value="php"/>

<rule ref="phpcs/command-running"/>
</ruleset>
Loading

0 comments on commit c7fae7d

Please sign in to comment.