Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
MKRazz committed Jul 11, 2017
0 parents commit 45e021c
Show file tree
Hide file tree
Showing 83 changed files with 3,660 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/vendor
composer.phar
composer.lock
.DS_Store
commit.bat
/src/views/*
/_ide_helper.php
/.idea
/lara5
/play.php
/_includes
/laravel
/tasks
/theme
/build/api
/build/code-browser
/build/coverage
/build/logs
/build/pdepend
/build/phpdoc
/build/phpdox
/build/phpdoxwd
/cache.properties
/phing
/.project
.idea
/test.php
/test.md
/psysh.phar
/app
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "build/tools"]
path = build/tools
url = https://github.com/robinradic/php-build-tools
branch = master
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- hhvm

#git:
# submodules: false

#before_install:
# - git submodule update --init --recursive --remote --force
# - git submodule foreach -q --recursive 'branch="$(git config -f $toplevel/.gitmodules submodule.$name.branch)"; git fetch --all; git checkout $branch; git pull'

before_script:
- composer self-update
- composer install

script:
- ./build/tools/phpunit.phar --configuration ./build/travis-ci.xml

notifications:
email: false
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License
http://radic.mit-license.org
Copyright © 2014 Robin Radic, Radic Technologies <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the “Software”),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
###This repository is for internal testing. Do not use.
206 changes: 206 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="blade-extensions" default="build">
<property name="toolsdir" value="${project.basedir}/build/tools/"/>
<property name="srcdir" value="${project.basedir}/src" />
<property name="testsdir" value="${project.basedir}/tests" />
<property name="changelog.header" value="# Changelog"/>
<property name="changelog.filename" value="CHANGELOG.md"/>
<property name="gitremote.url" value="https://github.com"/>
<property name="gitremote.owner" value="robinradic"/>
<property name="gitremote.repo" value="${phing.project.name}"/>

<if>
<equals arg1="${phing.project.name}" arg2="change-me" />
<then>
<fail message="You need to change the project name." />
</then>
</if>

<property name="changelog.header" value="# Changelog"/>
<property name="changelog.filename" value="CHANGELOG.md"/>
<target name="changelog">
<delete file="${changelog.filename}" quiet="true" />
<exec command='echo "${changelog.header} \n" >> ${changelog.filename}'/>
<exec command='git log --date=short --format="- [%cd](${gitremote.url}/${gitremote.owner}/${gitremote.repo}/commit/%H) %gs %s " >> ${changelog.filename}' logoutput="false"/>
<echo message="Created markdown changelog: ${changelog.filename}" />
</target>

<target name="git.submodule.update">
<exec command="bash ${project.basedir}/scripts/submodule-update.sh" dir="${project.basedir}" logoutput="true" />
</target>

<target name="build" depends="vendor,prepare,lint,phploc-ci,pdepend,phpcs-ci,phpcpd-ci,phpunit,phpdox,phpdoc" description=""/>

<target name="clean" unless="clean.done" description="Cleanup build artifacts">
<phingcall target="clean.build"/>
<phingcall target="clean.vendor"/>
<property name="clean.done" value="true"/>
</target>

<target name="clean.build" unless="clean.build.done" description="Cleanup build artifacts">
<delete dir="${project.basedir}/build/api"/>
<delete dir="${project.basedir}/build/coverage"/>
<delete dir="${project.basedir}/build/logs"/>
<delete dir="${project.basedir}/build/pdepend"/>
<delete dir="${project.basedir}/build/phpdox"/>
<delete dir="${project.basedir}/build/phpdoxwd"/>
<delete dir="${project.basedir}/build/phpdoc"/>
<property name="clean.build.done" value="true"/>
</target>

<target name="clean.vendor" unless="clean.vendor.done" description="Cleanup vendor files">
<delete dir="${project.basedir}/vendor"/>
<delete file="${project.basedir}/composer.lock"/>
<property name="clean.vendor.done" value="true"/>
</target>

<target name="vendor" depends="clean.vendor" unless="vendor.done" description="Cleanup composer and vendor">
<exec executable="composer" logoutput="true">
<arg line="install"/>
</exec>
<property name="vendor.done" value="true"/>
</target>


<target name="prepare" unless="prepare.done" depends="clean,git.submodule.update" description="Prepare for build">

<mkdir dir="${project.basedir}/build/coverage"/>
<mkdir dir="${project.basedir}/build/logs"/>
<mkdir dir="${project.basedir}/build/pdepend"/>
<mkdir dir="${project.basedir}/build/phpdox"/>
<mkdir dir="${project.basedir}/build/phpdoxwd"/>
<mkdir dir="${project.basedir}/build/phpdoc"/>
<exec executable="composer" logoutput="true">
<arg line="install"/>
</exec>
<property name="prepare.done" value="true"/>
</target>

<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l"/>

<fileset dir="${srcdir}" >
<include name="**/*.php"/>
</fileset>

<fileset dir="${testsdir}">
<include name="**/*.php"/>
</fileset>
</apply>
</target>

<target name="phploc" description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
<exec executable="${toolsdir}phploc.phar" logoutput="true">
<arg value="--count-tests"/>
<arg path="${srcdir}"/>
<arg path="${testsdir}"/>
</exec>
</target>

<target name="phploc-ci" depends="prepare" description="Measure project size using PHPLOC and log result in CSV and XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phploc.phar" logoutput="true">
<arg value="--count-tests"/>
<arg value="--log-csv"/>
<arg path="${project.basedir}/build/logs/phploc.csv"/>
<arg value="--log-xml"/>
<arg path="${project.basedir}/build/logs/phploc.xml"/>
<arg path="${srcdir}"/>
<arg path="${testsdir}"/>
</exec>
</target>

<target name="pdepend" depends="prepare" description="Calculate software metrics using PHP_Depend and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}pdepend.phar" logoutput="true">
<arg value="--jdepend-xml=${project.basedir}/build/logs/jdepend.xml"/>
<arg value="--jdepend-chart=${project.basedir}/build/pdepend/dependencies.svg"/>
<arg value="--overview-pyramid=${project.basedir}/build/pdepend/overview-pyramid.svg"/>
<arg path="${project.basedir}/src"/>
</exec>
</target>

<target name="phpmd" description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="${toolsdir}phpmd.phar" logoutput="true">
<arg path="${project.basedir}/src"/>
<arg value="text"/>
<arg path="${project.basedir}/build/phpmd.xml"/>
</exec>
</target>

<target name="phpmd-ci" depends="prepare" description="Perform project mess detection using PHPMD and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phpmd.phar" logoutput="true">
<arg path="${project.basedir}/src"/>
<arg value="xml"/>
<arg path="${project.basedir}/build/phpmd.xml"/>
<arg value="--reportfile"/>
<arg path="${project.basedir}/build/logs/pmd.xml"/>
</exec>
</target>

<target name="phpcbf" description="Fixes coding standard violations using PHP_CodeSniffer Fixer">

<exec executable="${toolsdir}phpcbf.phar" logoutput="true">
<arg value="--tabWidth=4"/>
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg value="--ignore=autoload.php"/>
<arg path="${srcdir}"/>
<arg path="${testsdir}"/>
</exec>
</target>

<target name="phpcs" depends="phpcbf" description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="${toolsdir}phpcs.phar" logoutput="true">
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg value="--ignore=autoload.php"/>
<arg path="${srcdir}"/>
<arg path="${testsdir}"/>
</exec>
</target>

<target name="phpcs-ci" depends="prepare" description="Find coding standard violations using PHP_CodeSniffer and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phpcs.phar" output="/dev/null">
<arg value="--report=checkstyle"/>
<arg value="--report-file=${project.basedir}/build/logs/checkstyle.xml"/>
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg value="--ignore=autoload.php"/>
<arg path="${srcdir}"/>
</exec>
</target>

<target name="phpcpd" description="Find duplicate code using PHPCPD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="${toolsdir}phpcpd.phar" logoutput="true">
<arg path="${srcdir}"/>
</exec>
</target>

<target name="phpcpd-ci" depends="prepare" description="Find duplicate code using PHPCPD and log result in XML format. Intended for usage within a continuous integration environment.">
<exec executable="${toolsdir}phpcpd.phar" logoutput="true">
<arg value="--log-pmd"/>
<arg path="${project.basedir}/build/logs/pmd-cpd.xml"/>
<arg path="${srcdir}"/>
</exec>
</target>

<target name="phpunit" depends="prepare" description="Run unit tests with PHPUnit">
<exec executable="${toolsdir}phpunit.phar" logoutput="true">
<arg value="--configuration"/>
<arg path="${project.basedir}/build/phpunit.xml"/>
</exec>
</target>

<target name="phpdox" depends="phploc-ci,phpcs-ci,phpmd-ci" description="Generate project documentation using phpDox">
<exec executable="${toolsdir}phpdox.phar" dir="${project.basedir}/build" logoutput="true"/>
</target>

<target name="phpdoc" depends="prepare" description="Generate project documentation using phpDocumentator">
<exec executable="${toolsdir}phpdoc.phar" dir="${project.basedir}/build" logoutput="true">
<arg line="-t ./phpdoc"/>
<arg line="-d ../src"/>
<arg line="--template=responsive-twig"/>
</exec>
</target>

</project>
26 changes: 26 additions & 0 deletions build/phpdox.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpdox xmlns="http://phpdox.net/config">
<project name="Blade Extensions" source="../src" workdir="phpdoxwd">
<collector publiconly="false">
<include mask="*.php" />
<exclude mask="*autoload.php" />


</collector>
<generator output=".">
<enrich base="logs">
<source type="build" />
<source type="git" />
<source type="phploc" />
<source type="checkstyle" />
<source type="pmd" />
<source type="phpunit" />
</enrich>

<build engine="html" enabled="true" output="phpdox">
<file extension="html" />
</build>
</generator>
</project>
</phpdox>

27 changes: 27 additions & 0 deletions build/phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>

<ruleset name="Blade Extensions"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Blade Extensions ruleset</description>

<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
<rule ref="rulesets/codesize.xml/NPathComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" />
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />

<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/design.xml/GotoStatement" />

<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />

<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter" />
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod" />
</ruleset>
30 changes: 30 additions & 0 deletions build/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
bootstrap="../vendor/autoload.php"
verbose="true"
timeoutForSmallTests="30"
timeoutForMediumTests="50"
timeoutForLargeTests="60"
>
<testsuites>
<testsuite name="Blade Extensions">
<directory suffix="Test.php">../tests</directory>
</testsuite>
</testsuites>

<logging>
<log type="coverage-html" target="coverage"/>
<log type="coverage-clover" target="logs/clover.xml"/>
<log type="coverage-crap4j" target="logs/crap4j.xml"/>
<log type="coverage-xml" target="logs/coverage"/>
<log type="junit" target="logs/junit.xml"/>
</logging>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../src</directory>
</whitelist>
</filter>
</phpunit>

Loading

0 comments on commit 45e021c

Please sign in to comment.