<commit_before><?php
/**
 * @title            Nudity Filter class
 *
 * @author           <NAME> <<EMAIL>>
 * @copyright        (c) 2016, <NAME>. All Rights Reserved.
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package          PH7 / Framework / Security / Moderation
 */

namespace PH7\Framework\Security\Moderation;
defined('PH7') or exit('Restricted access');

use PH7\Framework\File\Import;

class Filter
{
  /*
   * @return bool TRUE if it is a nude photo, FALSE otherwise.
   */
  public static function isNudity($sPath)
  {
      self::importLibrary();

      $oNudityFilter = new \Image_FleshSkinQuantifier($sPath);
      return $oNudityFilter->isPorn();
  }

  protected static function importLibrary()
  {
      Import::lib('FreebieStock.NudityDetector.Autoloader');
  }

  /**
   * Private constructor to prevent instantiation since it is a static class.
   */
  private function __construct() {}
}
<commit_msg>Better phpdoc<commit_after><?php
/**
 * @title            Nudity Filter class
 *
 * @author           <NAME> <<EMAIL>>
 * @copyright        (c) 2016, <NAME>. All Rights Reserved.
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package          PH7 / Framework / Security / Moderation
 */

namespace PH7\Framework\Security\Moderation;
defined('PH7') or exit('Restricted access');

use PH7\Framework\File\Import;

class Filter
{
  /**
   * @param string $sPath File path (e.g. $_FILES['file']['tmp_name'] ).
   * @return bool TRUE if it is a nude photo, FALSE otherwise.
   */
  public static function isNudity($sPath)
  {
      self::importLibrary();

      $oNudityFilter = new \Image_FleshSkinQuantifier($sPath);
      return $oNudityFilter->isPorn();
  }

  protected static function importLibrary()
  {
      Import::lib('FreebieStock.NudityDetector.Autoloader');
  }

  /**
   * Private constructor to prevent instantiation since it is a static class.
   */
  private function __construct() {}
}

{'fraction_non_alphanumeric': 0.12197483059051308, 'fraction_numerical': 0.00968054211035818, 'mean_word_length': 3.013592233009709, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '370563', 'n_tokens_mistral': 652, 'n_tokens_neox': 622, 'n_words': 174}