Skip to content

Commit

Permalink
Merge pull request #1 from jimdelois/feature-initial-prototyping
Browse files Browse the repository at this point in the history
Initial Functionality
  • Loading branch information
jimdelois committed Jun 4, 2016
2 parents c9dd784 + e106677 commit 8a392a8
Show file tree
Hide file tree
Showing 18 changed files with 965 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
languages:
PHP: true
5 changes: 5 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
service_name: travis-ci

coverage_clover: ./build/reports/phpunit-coverage-clover.xml

json_path: ./build/reports/phpunit-coveralls-upload.json
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Vendor Definitions
/composer.lock

# Vendor Directories
/vendor

# Editor/IDE Artifacts
/.idea

# User-Specific Overrides
/phpunit.xml

# Build artifacts
/build
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: php

php:
- 5.6
- hhvm
- nightly
- 7.0

before_install:
- "composer self-update"
- "sudo apt-get install graphviz"

install:
composer install --no-interaction

script:
php ./vendor/bin/phing build

after_success:
php ./vendor/bin/coveralls -v
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright (c) 2016, Improv Framework
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of Improv Framework nor the names of he, she, or its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

253 changes: 253 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
name="Improv Framework | Service Provisioning"
basedir="."
default="build"
description="The primary build file for the Service Provisioning Library by Improv Framework"
>


<property name="exec.php" value="/usr/bin/php" override="true" />
<property name="dir.build" value="build" />
<property name="dir.build.reports" value="${dir.build}/reports" />

<includepath classpath="./vendor/bin" />

<tstamp>
<format property="timestamp" pattern="%Y-%m-%d %H:%M" />
</tstamp>



<target name="static-analysis" depends="sniff,loc,cpd,pdepend,phpmd,phpmetrics" />

<target name="test" depends="test-unit" />

<target name="build" depends="prepare,static-analysis,test,documentapi" />


<target name="clean">
<delete dir="${dir.build}" includeemptydirs="true" verbose="true" />
</target>




<target name="prepare" depends="clean" description="Prepares files and directories for build">
<mkdir dir="${dir.build}" />
<mkdir dir="${dir.build.reports}" />
</target>




<target name="lint">
<phplint deprecatedAsError="true" haltonfailure="true">
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
<fileset dir="tests">
<include name="**/*.php"/>
</fileset>
</phplint>
</target>

<target name="sniff" depends="lint">

<phpcodesniffer
standard="PSR2"
docGenerator="HTML"
docFile="${dir.build.reports}/sniffs-guide.html"
verbosity="0"
haltonerror="true"
haltonwarning="true"
showSniffs="false"
showSources="true"
showWarnings="true"
>

<formatter type="full" outfile="${dir.build.reports}/sniffs-full.txt"/>
<formatter type="summary" outfile="${dir.build.reports}/sniffs-summary.txt"/>
<formatter type="checkstyle" outfile="${dir.build.reports}/sniffs-checkstyle.xml"/>

<formatter type="full" outfile="${dir.build.reports}/sniffs-full-console.txt" usefile="false"/>

<fileset dir="src">
<include name="**/*.php"/>
</fileset>
<fileset dir="tests">
<include name="**/*.php"/>
</fileset>

</phpcodesniffer>
</target>

<target name="loc" depends="sniff">

<property name="path.reports.loc" value="${dir.build.reports}/phploc-report.txt" />

<delete file="${path.reports.loc}" verbose="true" />

<phploc reportType="txt" reportDirectory="${dir.build.reports}" reportName="phploc-report">
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
</phploc>

<exec
executable="cat"
checkreturn="false"
passthru="true">
<arg path="${path.reports.loc}" />
</exec>

</target>

<target name="cpd" depends="sniff">

<property name="path.reports.phpcpd.xml" value="${dir.build.reports}/phpcpd-report.xml" />
<property name="path.reports.phpcpd.txt" value="${dir.build.reports}/phpcpd-report.txt" />

<delete file="${path.reports.phpcpd.xml}" verbose="true" />
<delete file="${path.reports.phpcpd.txt}" verbose="true" />

<phpcpd>
<fileset dir="src">
<include name="**/*.php"/>
</fileset>
<formatter type="pmd" outfile="${path.reports.phpcpd.xml}"/>
<formatter type="default" outfile="${path.reports.phpcpd.txt}"/>
<formatter type="default" useFile="false" outfile="${path.reports.phpcpd.txt}"/>
</phpcpd>

</target>

<target name="pdepend">

<delete file="${dir.build.reports}/pdepend-chart.svg" verbose="true" />
<delete file="${dir.build.reports}/pdepend.xml" verbose="true" />
<delete file="${dir.build.reports}/pdepend-overview-pyramid.svg" verbose="true" />
<delete file="${dir.build.reports}/pdepend-phpunit.xml " verbose="true" />
<delete file="${dir.build.reports}/pdepend-summary.xml" verbose="true" />

<phpdepend>
<fileset dir="src">
<include name="**/*.php"/>
</fileset>

<!-- <analyzer type="coderank-mode" value="method"/> -->

<logger type="jdepend-xml" outfile="reports/jdepend.xml"/>
<logger type="jdepend-chart" outfile="${dir.build.reports}/pdepend-chart.svg" />
<logger type="jdepend-xml" outfile="${dir.build.reports}/pdepend.xml" />
<logger type="overview-pyramid" outfile="${dir.build.reports}/pdepend-overview-pyramid.svg" />
<logger type="summary-xml" outfile="${dir.build.reports}/pdepend-summary.xml" />

</phpdepend>

</target>


<target name="phpmd">

<delete file="${dir.build.reports}/phpmd.html" verbose="true"/>
<delete file="${dir.build.reports}/phpmd.xml" verbose="true"/>
<delete file="${dir.build.reports}/phpmd.txt" verbose="true"/>

<property name="phpmd.rulesets" value="cleancode,codesize,design,naming,unusedcode" />

<!-- We run this task to generate all the right reports... -->
<phpmd rulesets="${phpmd.rulesets}" minimumPriority="0">

<fileset dir="src">
<include name="**/*.php"/>
</fileset>
<fileset dir="tests">
<include name="**/*.php"/>
</fileset>

<formatter type="html" outfile="${dir.build.reports}/phpmd.html"/>
<formatter type="xml" outfile="${dir.build.reports}/phpmd.xml"/>
<formatter type="text" outfile="${dir.build.reports}/phpmd.txt"/>

</phpmd>

<!-- This is the only way to get output to the screen and to FAIL the build -->
<exec executable="./vendor/bin/phpmd" checkreturn="true" logoutput="true" passthru="true">
<arg path="src,tests" />
<arg value="text" />
<arg value="${phpmd.rulesets}" />
</exec>

</target>

<target name="phpmetrics">

<exec executable="./vendor/bin/phpmetrics" checkreturn="true" logoutput="true" passthru="true">
<arg value="--config" />
<arg path="phpmetrics.yml.dist" />
</exec>

</target>


<target name="documentapi">

<mkdir dir="${dir.build}/docs/api" />

<phpdoc2 title="API Documentation"
destdir="${dir.build}/docs/api"
template="clean">
<fileset dir="./src">
<include name="**/*.php" />
</fileset>
</phpdoc2>
</target>






<target name="test-unit" depends="lint">
<exec
executable="./vendor/bin/phpunit-randomizer"
dir="."
checkreturn="true"
passthru="true"
>
<!-- <arg value="- -testdox" /> -->
</exec>
</target>




<target name="package" depends="build">


<mkdir dir="${dir.build}/artifacts/src-package" />

<copy todir="${dir.build}/artifacts/src-package" >
<fileset dir=".">
<include name="src/**/*" />
<include name="tests/**/*" />
</fileset>
<filelist dir="." files="composer.json,LICENSE,README.md"/>
</copy>

<exec
executable="tar"
checkreturn="true"
dir="${dir.build}/artifacts"
>
<arg value="-cvzf" /><arg path="src-package.tar.gz" />
<arg path="src-package/" />
</exec>

<delete dir="${dir.build}/artifacts/src-package" includeemptydirs="true" verbose="true" />
</target>



</project>
45 changes: 45 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name" : "improvframework/service-provisioning" ,
"description": "A ContainerInterop-compatible package intended to ease the organization and loading of container services.",
"type": "library",
"keywords": [
"keywords"
],
"homepage": "https://github.com/improvframework/service-provisioning",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Jim DeLois",
"email": "jim.delois@improvframework.org",
"homepage": "https://www.improvframework.org"
}
],
"minimum-stability": "stable",
"require": {
"php": ">=5.6.0",
"container-interop/container-interop": "^1.1"
},
"require-dev" : {
"fiunchinho/phpunit-randomizer": "^2.0",
"pdepend/pdepend": "^2.2",
"phing/phing": "^2.14",
"phpdocumentor/phpdocumentor": "^2.9",
"phploc/phploc": "^3.0",
"phpmd/phpmd": "^2.4",
"phpmetrics/phpmetrics": "^1.10",
"phpunit/phpunit": "^5.4",
"satooshi/php-coveralls": "^1.0",
"sebastian/phpcpd": "^2.0",
"squizlabs/php_codesniffer": "^2.6"
},
"autoload": {
"psr-4": {
"Improv\\ServiceProvisioning\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Improv\\ServiceProvisioning\\Test\\": "tests/lib"
}
}
}
14 changes: 14 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<ruleset name="service-provisioning">
<description>The coding standard for the Service Provisioning project</description>

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

<arg name="report" value="full"/>
<arg name="report-width" value="auto"/>
<arg value="wp"/>
<arg name="colors"/>

<rule ref="PSR2"/>
</ruleset>
Loading

0 comments on commit 8a392a8

Please sign in to comment.