Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'joomla/master' into manual
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Dec 2, 2011
2 parents 1ff8c1a + df40289 commit 89b924c
Show file tree
Hide file tree
Showing 73 changed files with 3,443 additions and 3,273 deletions.
36 changes: 31 additions & 5 deletions build/phpcs/Joomla/Sniffs/WhiteSpace/ConcatenationSpacingSniff.php
Expand Up @@ -55,9 +55,30 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

if($tokens[($stackPtr - 1)]['code'] != T_WHITESPACE
|| $tokens[($stackPtr + 1)]['code'] != T_WHITESPACE
)
if($tokens[($stackPtr + 1)]['code'] != T_WHITESPACE)
{
// space after
$message = 'Concat operator must be followed by one space';
$phpcsFile->addError($message, $stackPtr, 'Missing');
}
else
{
$found = strlen($tokens[($stackPtr + 1)]['content']);

if($found > 1)
{
$error = sprintf('Expected 1 space after concat operator; %s found', $found);
$phpcsFile->addError($error, $stackPtr, 'Too much');
}
}

if($tokens[($stackPtr - 1)]['code'] != T_WHITESPACE)
{
// space before
$message = 'Concat operator must be preceeded by one space';
$phpcsFile->addError($message, $stackPtr, 'Missing');
}
else
{
if(strpos($tokens[($stackPtr - 2)]['content'], $phpcsFile->eolChar) !== false
|| strpos($tokens[($stackPtr - 1)]['content'], $phpcsFile->eolChar) !== false)
Expand All @@ -66,8 +87,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
return;
}

$message = 'Concat operator must be surrounded by spaces';
$phpcsFile->addError($message, $stackPtr, 'Missing');
$found = strlen($tokens[($stackPtr - 1)]['content']);

if($found > 1)
{
$error = sprintf('Expected 1 space before concat operator; %s found', $found);
$phpcsFile->addError($error, $stackPtr, 'Too much');
}
}
}//function
}//class
14 changes: 0 additions & 14 deletions docs/coding-standards/book.xml

This file was deleted.

8 changes: 8 additions & 0 deletions docs/coding-standards/en-US/Author_Group.xml
@@ -0,0 +1,8 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<authorgroup>
<corpauthor>Joomla! Platform Project</corpauthor>
</authorgroup>
28 changes: 28 additions & 0 deletions docs/coding-standards/en-US/Book_Info.xml
@@ -0,0 +1,28 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<bookinfo id="book-Coding_Standards-coding_standards">
<title>Coding Standards</title>
<subtitle>A Concise Guide</subtitle>
<productname>Joomla Platform</productname>
<productnumber>11.3</productnumber>
<edition>1</edition>
<pubsnumber>1</pubsnumber>
<abstract>
<para>
A concise guide to the Joomla! Platform coding standards.
</para>
</abstract>
<corpauthor>
<inlinemediaobject>
<imageobject>
<imagedata fileref="Common_Content/images/title_logo.png" />
</imageobject>
</inlinemediaobject>
</corpauthor>
<xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</bookinfo>

33 changes: 33 additions & 0 deletions docs/coding-standards/en-US/Chapter.xml
@@ -0,0 +1,33 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Coding_Standards-Test_Chapter">
<title>Test Chapter</title>
<para>
This is a test paragraph
</para>
<section id="sect-Coding_Standards-Test_Chapter-Test_Section_1">
<title>Test Section 1</title>
<para>
This is a test paragraph in a section
</para>
</section>

<section id="sect-Coding_Standards-Test_Chapter-Test_Section_2">
<title>Test Section 2</title>
<para>
This is a test paragraph in Section 2
<orderedlist>
<listitem>
<para>
listitem text
</para>
</listitem>
</orderedlist>
</para>
</section>

</chapter>

4 changes: 4 additions & 0 deletions docs/coding-standards/en-US/Coding_Standards.ent
@@ -0,0 +1,4 @@
<!ENTITY PRODUCT "Joomla Platform">
<!ENTITY BOOKID "Coding_Standards">
<!ENTITY YEAR "2011">
<!ENTITY HOLDER "| Open Source Matters |">
14 changes: 14 additions & 0 deletions docs/coding-standards/en-US/Coding_Standards.xml
@@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<book>
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chapters/source-code-management.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chapters/basic-guidelines.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="chapters/php.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="appendices/Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<index />
</book>
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<preface version="5.0" xml:id="preface" xmlns="http://docbook.org/ns/docbook" xmlns:ns5="http://www.w3.org/1999/xhtml"
xmlns:ns4="http://www.w3.org/1998/Math/MathML" xmlns:ns3="http://www.w3.org/2000/svg"
xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns="http://docbook.org/ns/docbook">
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<preface id="pref-Coding_Standards-Preface">
<title>Preface</title>

<para>One of the things that sets good software apart from great software is not the features or the actual function the
Expand All @@ -20,3 +22,4 @@
<para>The Joomla Coding Standards borrows heavily from the PEAR coding standard for PHP files, augmenting and diverging where it
is deemed sensible to do so</para>
</preface>

26 changes: 26 additions & 0 deletions docs/coding-standards/en-US/appendices/Revision_History.xml
@@ -0,0 +1,26 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "coding-standards.ent">
%BOOK_ENTITIES;
]>
<appendix id="appe-coding-standards-Revision_History">
<title>Revision History</title>
<simpara>
<revhistory>
<revision>
<revnumber>0-0</revnumber>
<date>Thu Dec 1 2011</date>
<author>
<firstname>Ian</firstname>
<surname>MacLennan</surname>
</author>
<revdescription>
<simplelist>
<member>Initial import of book into Publican</member>
</simplelist>
</revdescription>
</revision>
</revhistory>
</simpara>
</appendix>

@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0" xml:id="ch2" xmlns="http://docbook.org/ns/docbook" xmlns:ns5="http://www.w3.org/1999/xhtml"
xmlns:ns4="http://www.w3.org/1998/Math/MathML" xmlns:ns3="http://www.w3.org/2000/svg"
xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns="http://docbook.org/ns/docbook">
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Coding_Standards.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Coding_Standards-Basic_Guidelines">
<title>Basic Guidelines</title>

<section>
<title></title>

<para>This chapter outlines the basic guidelines that cover and files.</para>
</section>
<para>This chapter outlines the basic guidelines that cover and files.</para>

<section>
<title>File Format</title>
Expand Down

0 comments on commit 89b924c

Please sign in to comment.