FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18053&edit=1

ID: 18053
Updated by: gsherwood@squiz.net
Reported By: dobes at lnx dot cz
Summary: Problem to include custom standard sniffs
-Status: Open
+Status: Wont fix
Type: Bug
Package: PHP_CodeSniffer
Operating System: Irelevant
Package Version: 1.2.2
PHP Version: Irrelevant
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Wont fix
-Assigned To:
+Assigned To: squiz
I suggest you upgrade to 1.3.0RC1 and use the new ruleset.xml format. It
is much more flexible and I am not fixing any issues with the current
1.2.x method of creating custom sniffs.

Guide for upgrading is here:
http://www.squizlabs.com/php-codesniffer/upgrading-for-1.3.0


Previous Comments:
------------------------------------------------------------------------

[2010-11-14 15:05:10] paveld

Description:
------------
Hi,

I had problem to include my own custom standard (std) files.

When the std is included in PEAR directlry it is OK but when
custom std I have error:

Included sniff My/Sniffs/File/LineLenghtSniff.php does not exist
in <PEAR_PATH>/PHP/CodeSniffer.php on line 433.

The check is only in current working dir and not counting
different location (i tired to change include path first).

It is working for me only if I include absolute path.


Test script:
---------------
in MyCodingStandard.php file:

method getincludedSniffs() contains:

not working:

return array(
'My/Sniffs/File/LineLenghtSniff.php',
);

working:
$ds = DIRECTORY_SOPARATOR;
$dn = dirname(__FILE__);

return array(
"{$dn}{$ds}Sniffs{$ds}File{$ds}LineLenghtSniff.php",
);


Expected result:
----------------
The 'My/Sniffs/File/LineLenghtSniff.php' will be working fine.

Actual result:
--------------
Included sniff My/Sniffs/File/LineLenghtSniff.php does not exist in
<PEAR_PATH>/PHP/CodeSniffer.php on line 433.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 17, '10 at 2:33a
activeNov 17, '10 at 2:33a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase