Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Bug #10/ #14, Fixes to composer.json & PSR2-based code standard
Browse files Browse the repository at this point in the history
* PHP_CodeSniffer XML [iet:3633574]
* composer.json [iet:3634843]
  • Loading branch information
nfreear committed Jun 18, 2015
1 parent 97dc213 commit 6c7b7de
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
18 changes: 6 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,37 @@
"nfreear/ou-media-player-test": "*; Remote integration tests.",
"IET-OU/mediaelement-demo": "*; Demos for IET-OU enhancements & fixes to MediaElement.js",

"fancyguy/webroot-installer": "1.1.0",
"wikimedia/composer-merge-plugin": "v1.0.0",
"nfreear/composer-suggest": "^1.1"
},
"scripts": {
"test-psr2": [
"test": [
"#echo $1",
"#export F=application/$1 ;",
"#composer validate #--no-interaction",
"#parallel-lint application/*",
"phpcs --standard=PSR2 -n --encoding=utf-8 --extensions=php application/core/MY_Co*"
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/core/*"
],
"test-oump": [
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/core/MY_Co*"
"test-psr2": [
"phpcs --standard=PSR2 -n --encoding=utf-8 --extensions=php application/core/MY_Co*"
],

"test-v": [
"phpcs --standard=./phpcs.xml -n --encoding=utf-8 --extensions=php application/views/vle_d*"
],

"fix-psr2": [
"phpcbf --standard=PSR2 -n -l --encoding=utf-8 --extensions=php application/core/MY_Contr*"
"phpcbf --standard=PSR2 -n -l --encoding=utf-8 --extensions=php application/core/MY_Co*"
],
"fix-oump": [
"phpcbf --standard=./phpcs.xml -n -l --encoding=utf-8 --extensions=php application/core/MY_Co*"
"phpcbf --standard=./phpcs.xml -n -l --encoding=utf-8 --extensions=php application/core/*"
]
},
"config": {
"preferred-install": "source"
},
"extra": {

"webroot-dir": "application/engines/mediaelement-x",
"webroot-package": "johndyer/mediaelement",

"installer-paths": {
"./application/engines/mediaelement-x": [ "johndyer/mediaelement" ]
},
Expand All @@ -104,8 +100,6 @@
"https://github.com/IET-OU/ouplayer ../system/core/CodeIgniter.php#L36 - CI 2.1.3",
"http://iet-embed-acct.open.ac.uk/docs/CREDITS.txt",

"TODO: rm cache/ hooks/ logs/ migrations/ third_party/",

"https://gist.github.com/nfreear/57262e040d49b2f212ec"
]
}
Expand Down
19 changes: 14 additions & 5 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
<?xml version="1.0"?>
<ruleset name="mediaplayer-open-ac-uk">
<description>OU Media Player coding standard - PSR2, almost!</description>

<!--
Stay as close to PSR-2 as possible, but account for CodeIgniter conventions.
https://github.com/squizlabs/PHP_CodeSniffer ./Standards/PSR2/ruleset.xml
https://github.com/cakephp/cakephp-codesniffer ./CakePHP/ruleset.xml
http://edorian.github.io/php-coding-standard-generator/#phpcs
-->

<exclude-pattern>\.git</exclude-pattern>
<exclude-pattern>/application/assets/</exclude-pattern>
<exclude-pattern>/application/cli/</exclude-pattern>
<exclude-pattern>/application/config/</exclude-pattern>
<exclude-pattern>/application/engines/</exclude-pattern>
<exclude-pattern>/system/</exclude-pattern>
<exclude-pattern>/vendor/</exclude-pattern>
<exclude-pattern>*/*.html</exclude-pattern>
<exclude-pattern>*/*BAK*</exclude-pattern>

<rule ref="PSR2">
<exclude name="PSR2.Methods.MethodDeclaration"/>
<!--<exclude name="PSR2.Classes.PropertyDeclaration"/>-->
</rule>

<rule ref="PSR1">
<exclude name="PSR1.Methods.CamelCapsMethodName"/>
<!--<exclude name="PSR1.Classes.ClassDeclaration"/><!-|- namespace -->
<exclude name="PSR1.Files.SideEffects"/>
<exclude name="PSR1.Methods.CamelCapsMethodName"/>

<!--
For the moment, don't require namespaces.
-->
<exclude name="PSR1.Classes.ClassDeclaration"/>

<!--<exclude name="PSR1.Files.SideEffects"/>-->
</rule>

<rule ref="Squiz.Classes">
Expand Down

0 comments on commit 6c7b7de

Please sign in to comment.