sohoa / framework
此包最新版本(dev-master)的许可证信息不可用。
dev-master
2015-08-04 18:26 UTC
Requires
- php: >=5.4.0
- hoa/console: ~2.0
- hoa/core: ~2.0
- hoa/dispatcher: ~0.0
- hoa/file: ~0.0
- hoa/http: ~0.0
- hoa/registry: ~2.0
- hoa/router: ~2.0
- hoa/session: ~0.0
- hoa/stringbuffer: ~0.0
- hoa/view: ~2.0
Requires (Dev)
- atoum/atoum: dev-master
Suggests
- hoa/xyl: To use Sohoa\Framework\View\Xyl adapter in your project
This package is not auto-updated.
Last update: 2024-09-23 15:05:09 UTC
README
基于Hoa的PHP框架
编码规范 / PSR1-2 / Git钩子
Sohoa/Framework遵守PSR1和PSR2编码规范。为了方便工作,我们使用了PHP-CS-Fixer工具,它可以自动检查并修正不符合PSR1和PSR2标准的代码。使用以下命令:
php /path/to/php-cs-fixer.php fix /path/to/the/framework
我们还可以将此检查添加到Git的pre-commit钩子中。为此,需要在本地存储库的.git目录下的pre-commit文件中添加大量代码,这些代码大部分来自LilaConcepts
感谢lilaconcepts提供的简单检查
#!/bin/sh
PROJECTROOT=`echo $(cd ${0%/*}/../../ && pwd -P)`/
FIXER=php-cs-fixer.phar
if [ ! -e ${PROJECTROOT}${FIXER} ]; then
echo "PHP-CS-Fixer not available, downloading to ${PROJECTROOT}${FIXER}..."
curl -s http://cs.sensiolabs.org/get/$FIXER > ${PROJECTROOT}${FIXER}
echo "Done. First time to check the Coding Standards."
echo ""
fi
RES=`php ${PROJECTROOT}${FIXER} fix $PROJECTROOT --verbose --dry-run`
if [ "$RES" != "" ]; then
echo "Coding standards are not correct, cancelling your commit."
echo ""
echo $RES
echo ""
echo "If you want to fix them run:"
echo ""
echo " php ${PROJECTROOT}${FIXER} fix ${PROJECTROOT} --verbose"
echo ""
exit 1
fi
提示
如果要不通过钩子提交,可以使用以下命令:
git commit -m "message" --no-verify