Skip to content

[Doc] Cover all errors of PEAR ClassDeclaration #856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,78 @@ class Foo <em>{</em>
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: Opening brace on the correct line.">
<![CDATA[
class Foo
<em>{</em>
}
]]>
</code>
<code title="Invalid: Newline between declaration and opening brace.">
<![CDATA[
class Foo
<em></em>
{
}
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: Opening brace is on a line by itself.">
<![CDATA[
class Foo
<em>{</em>
}
]]>
</code>
<code title="Invalid: Opening brace is not alone on its line.">
<![CDATA[
class Foo
{<em> public function __construct() {}</em>
}
]]>
</code>
</code_comparison>
<standard>
<![CDATA[
The opening brace must be indented to the same depth as the class declaration.
]]>
</standard>
<code_comparison>
<code title="Valid: Opening brace indentation depth matches the class definition.">
<![CDATA[
if (!class_exists('Foo')) {
abstract class Foo
<em>{</em>
}
}
]]>
</code>
<code title="Invalid: Expected 4 spaces before opening brace; 0 found.">
<![CDATA[
if (!class_exists('Foo')) {
abstract class Foo
<em>{</em>
}
}
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: Opening brace indentation depth matches the class definition.">
<![CDATA[
class Foo
<em>{</em>
}
]]>
</code>
<code title="Invalid: Expected 0 spaces before opening brace; 4 found.">
<![CDATA[
class Foo
<em>{</em>
}
]]>
</code>
</code_comparison>
</documentation>