From 64f90920ce1651a0d4ccdd45b6d2506b7f578b8a Mon Sep 17 00:00:00 2001
From: Darren Oh <darren@oh.name>
Date: Mon, 23 Dec 2013 14:25:58 -0500
Subject: [PATCH] Issue #2159567 by Darren Oh: Removed private keyword sniff.

---
 .../Drupal/Sniffs/Classes/PrivateKeywordSniff.php  | 54 ----------------------
 coder_sniffer/Test/bad.php                         |  2 +-
 coder_sniffer/Test/good.php                        |  5 +-
 3 files changed, 5 insertions(+), 56 deletions(-)
 delete mode 100644 coder_sniffer/Drupal/Sniffs/Classes/PrivateKeywordSniff.php

diff --git a/coder_sniffer/Drupal/Sniffs/Classes/PrivateKeywordSniff.php b/coder_sniffer/Drupal/Sniffs/Classes/PrivateKeywordSniff.php
deleted file mode 100644
index b927971..0000000
--- a/coder_sniffer/Drupal/Sniffs/Classes/PrivateKeywordSniff.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
- * Drupal_Sniffs_Classes_PrivateKeywordSniff.
- *
- * PHP version 5
- *
- * @category PHP
- * @package  PHP_CodeSniffer
- * @link     http://pear.php.net/package/PHP_CodeSniffer
- */
-
-/**
- * Verifies that the "private" keyword is not used.
- *
- * @category PHP
- * @package  PHP_CodeSniffer
- * @link     http://pear.php.net/package/PHP_CodeSniffer
- */
-class Drupal_Sniffs_Classes_PrivateKeywordSniff implements PHP_CodeSniffer_Sniff
-{
-
-
-    /**
-     * Returns an array of tokens this test wants to listen for.
-     *
-     * @return array
-     */
-    public function register()
-    {
-        return array(T_PRIVATE);
-
-    }//end register()
-
-
-    /**
-     * Processes this test, when one of its tokens is encountered.
-     *
-     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
-     * @param int                  $stackPtr  The position of the current token in
-     *                                        the stack passed in $tokens.
-     *
-     * @return void
-     */
-    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
-    {
-        $warn = 'The use of private methods or properties is strongly discouraged, use "protected" instead';
-        $phpcsFile->addWarning($warn, $stackPtr, 'PrivateKeyword');
-
-    }//end process()
-
-
-}//end class
-
-?>
diff --git a/coder_sniffer/Test/bad.php b/coder_sniffer/Test/bad.php
index 4edf4a6..3d54d2d 100644
--- a/coder_sniffer/Test/bad.php
+++ b/coder_sniffer/Test/bad.php
@@ -413,7 +413,7 @@ Class FunctionTest {
   }
 
   /**
-   * Asterisks of this comment are wrong. And "private" should no be used.
+   * Asterisks of this comment are wrong.
   *
     */
   private function foobar() {
diff --git a/coder_sniffer/Test/good.php b/coder_sniffer/Test/good.php
index bdf03b5..ad6256f 100644
--- a/coder_sniffer/Test/good.php
+++ b/coder_sniffer/Test/good.php
@@ -296,7 +296,10 @@ $var = foo(
  */
 class Bar {
 
-  // Public properties don't have a prefix.
+  // Private properties have no prefix.
+  private $secret = 1;
+
+  // Public properties also don't a prefix.
   protected $foo = 1;
 
   // Longer properties use camelCase naming.
-- 
1.8.2

