Skip to content

Commit

Permalink
Merge pull request #117 from pH7Software/phpcs
Browse files Browse the repository at this point in the history
PHPCS - part1
  • Loading branch information
pH-7 authored Apr 2, 2017
2 parents ac98823 + 8a01333 commit dd9b5a3
Showing 9 changed files with 66 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -16,6 +16,8 @@ _protected/data/cache/*
_protected/vendor/*
composer.phar
phpunit.phar
.php_cs
.php_cs.cache
*.log
*.tmp

35 changes: 35 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

$aRules = [
'@PSR2' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'general_phpdoc_annotation_remove' => ['expectedException', 'expectedExceptionMessage', 'expectedExceptionMessageRegExp'],
'heredoc_to_nowdoc' => true,
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
'no_short_echo_tag' => true,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'psr4' => true,
'strict_comparison' => true,
'strict_param' => true,
'standardize_not_equals' => true
];

return PhpCsFixer\Config::create()
->setRiskyAllowed(false)
->setRules($aRules)
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('library')
->in('_protected')
)
;
2 changes: 1 addition & 1 deletion _install/library/Controller.class.php
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ abstract class Controller implements Controllable
SOFTWARE_COPYRIGHT = '© (c) 2012-2017, Pierre-Henry Soria. All Rights Reserved.',
// 1.0, 1.1 branches were "pOH", 1.2 was "pOW", 1.3, 1.4 were "p[H]", 2.* was "H2O", 3.* was "H3O", 4.* was "HCO", 5.* was "pCO" and 6.* is "WoW"
SOFTWARE_VERSION_NAME = 'WoW',
SOFTWARE_VERSION = '6.0.8',
SOFTWARE_VERSION = '6.0.9',
SOFTWARE_BUILD = '1',
DEFAULT_LANG = 'en',
DEFAULT_THEME = 'base';
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@
{lang 'Unlock all premium features and use your site for commercial use'}
</a>
</h2>

{{ LicenseForm::display() }}
<p class="thumb"><img src="{url_tpl_mod_img}staring-eyes.jpg" alt="Staring Eyes" /></p>

<p class="thumb">
<img src="{url_tpl_mod_img}staring-eyes.jpg" alt="Staring Eyes" title="{lang 'We have Eyes on You'}" />
</p>
</div>
4 changes: 2 additions & 2 deletions _protected/framework/Security/Version.class.php
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@ final class Version
/***** Framework Kernel *****/
// 1.0, 1.1 branches were "pOH", 1.2 was "pOW", 1.3, 1.4 were "p[H]", 2.* was "H2O", 3.* was "H3O", 4.* was "HCO", 5.* was "pCO" and 6.* is "WoW"
const KERNEL_VERSION_NAME = 'WoW';
const KERNEL_VERSION = '6.0.8';
const KERNEL_VERSION = '6.0.9';
const KERNEL_BUILD = '1';
const KERNEL_RELASE_DATE = '2017-03-27';
const KERNEL_RELASE_DATE = '2017-04-04';

/***** Framework Server *****/
const KERNEL_TECHNOLOGY_NAME = 'pH7T/1.0.1'; // Ph7 Technology
6 changes: 6 additions & 0 deletions _tools/deployment.sh
Original file line number Diff line number Diff line change
@@ -75,6 +75,12 @@ function run() {
rm -rf ./_tests/
rm -rf ./.git/

## PHPCS
rm ./phpcs.xml.dist
rm ./.php_cs
rm ./.php_cs.cache
rm ./.php_cs.dist

## TMP folders
# elFinder cache folders
rm -rf ./.quarantine/
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -41,7 +41,8 @@
},
"require-dev": {
"phpunit/phpunit": "^5.5",
"phake/phake": "^2.3"
"phake/phake": "^2.3",
"friendsofphp/php-cs-fixer": "^2.2"
},
"autoload-dev": {
"psr-4": {
9 changes: 9 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<ruleset name="PHP_CodeSniffer">
<file>_protected</file>

<arg name="colors"/>
<arg name="report" value="full"/>

<rule ref="PSR2"/>
</ruleset>
8 changes: 4 additions & 4 deletions templates/themes/base/tpl/top_menu.inc.tpl
Original file line number Diff line number Diff line change
@@ -452,14 +452,14 @@
{if !$is_valid_license}
<li><a class="bold underline" href="{software_license_url}" title="{lang 'Buy a License Key'}"><i class="fa fa-key"></i> {lang 'Switch to pH7CMSPro'}</a></li>
{/if}
<li><a href="https://clients.hizup.com/buy-custom-development" title="{lang 'Need Customization/New Feature?'}"><i class="fa fa-wrench"></i> {lang 'Customization/New Feature'}</a></li>
<li><a href="{software_help_url}" title="{lang 'Need Professional Technical Supports?'}"><i class="fa fa-life-ring"></i> {lang 'Technical Support'}</a></li>
<li><a href="{software_doc_url}" title="{lang 'Software Documentation'}"><i class="fa fa-book"></i> {lang 'Documentation'}</a></li>
<li><a href="{software_faq_url}" title="{lang 'Frequently Asked Questions'}"><i class="fa fa-question"></i> {lang 'FAQ'}</a></li>
<li><a href="http://ph7cms.com/how-to-report-bugs" title="{lang 'Report a Problem'}"><i class="fa fa-bug"></i> {lang 'Report a Bug'}</a></li>
<li><a href="http://smartfreelancer.top" title="{lang 'Are you selling on Fiverr? Market and Boost your Gigs Today!'}"><i class="fa fa-star-o"></i> {lang 'Are you a Fiverr seller? Market your Gigs!'}</a></li>
<li><a href="https://github.com/pH7Software/pH7-Social-Dating-CMS/issues/" title="{lang 'Report a Problem'}"><i class="fa fa-bug"></i> {lang 'Report a Bug'}</a></li>
<li><a href="http://appninja.space" title="{lang 'Do you have Android Apps..? Boost them with a full marketing service!'}"><i class="fa fa-star"></i> {lang 'Market your Android Apps'}</a></li>
<li><a href="http://smartfreelancer.top" title="{lang 'Are you selling on Fiverr? Market and Boost your Gigs Today!'}"><i class="fa fa-star-o"></i> {lang 'Are you selling Fiverr? Market your Gigs!'}</a></li>
{* Coming soon ...
<li><a href="{software_forum_url}" title="{lang 'Support Forum'}">{lang 'Forum'}</a></li>
<li><a href="{software_forum_url}" title="{lang 'Support Forum'}">{lang 'Forum'}</a></li>
*}
</ul>
</li>

0 comments on commit dd9b5a3

Please sign in to comment.