<commit_before><?php

namespace PHPagstract\Symbol\Symbols;

/**
 * abstract property symbol class
 *
 * @package   PHPagstract
 * @author    <NAME> <<EMAIL>>
 * @link      https://gitlab.bjoernbartels.earth/php/phpagstract
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
 * @copyright copyright (c) 2016 <NAME> <<EMAIL>>
 */
abstract class AbstractPropertySymbol {
    
	/**
	 * symbol name
	 *
	 * @var Name
	 */
	private $name = 'Symbol';
    
	/**
	 * property type
	 *
	 * @var string
	 */
	private $type = null;

	/**
	 * parent symbol
	 * 
	 * @var Symbol
	 */
	private $parent;

	/**
	 * property container/reference
	 *
	 * @var \stdClass
	 */
	private $property = null;

	/**
	 * @param string $type
	 */
	public function __construct($type, $name, AbstractPropertySymbol & $parent = null) {
		if ($parent !== null) {
			$this->parent = & $parent;
		}
		$this->setName($name);
		$this->setType($type);
	}
    
	/**
	 * convert symbol data to array
	 *
	 * @return array
	 */
	public function serialize()
	{
		$result = get_object_vars($this);
		if (isset($result["parent"]))unset($result["parent"]);
		if (isset($result["items"])) {
			$items = [];
			foreach ($result["items"] as $key => $item) {
				$items[] = $item->serialize();
			}
			$result["items"] = $items;
		}
		if (isset($result["properties"])) {
			$properties = get_object_vars($result["properties"]);
			$items = [];
			foreach ($properties as $key => $item) {
				$items[$key] = $item->serialize();
			}
			$result["properties"] = (object) $items;
		}
		return $result;
	}
    
	//
	// get/set new property
	//
    
	/**
	 * get a property's value
	 * 
	 * @param string $property the property name
	 * @return mixed|NULL
	 */
	public function get($property) {
		if (isset($this->$property)) {
			return $this->$property;
		}
		return null;
	}
    
	/**
	 * set a property's value
	 * 
	 * @param string $property the property name
	 * @param mixed $value
	 * @return self
	 */
	public function set($property, $value) {
		$this->$property = $value;
		return $this;
	}
    
	//
	// getter/setters
	//

	/**
	 * get the property
	 *
	 * @return AbstractPropertySymbol
	 */
	public function getParent() 
	{
		if ($this->parent === null) {
			return $this;
		}
		return $this->parent;
	}
    
	/**
	 * set the property
	 *
	 */
	public function setParent(AbstractPropertySymbol $parent) 
	{
		$this->parent = $parent;
		return $this;
	}

	/**
	 * get the property
	 *
	 * @return \stdClass
	 */
	public function getProperty() 
	{
		return $this->property;
	}
    
	/**
	 * set the property
	 *
	 * @param mixed $property
	 */
	public function setProperty($property) 
	{
		$this->property = $property;
		return $this;
	}

	/**
	 * get the property type
	 *
	 * @return string
	 */
	public function getType() 
	{
		return $this->type;
	}
    
	/**
	 * set the property type
	 *
	 * @param string $type
	 */
	public function setType($type) 
	{
		$this->type = $type;
		return $this;
	}
    
	/**
	 * get the name
	 *
	 * @return string
	 */
	public function getName() 
	{
		return (string) $this->name;
	}
    
	/**
	 * set the name
	 *
	 * @param string $name
	 */
	public function setName($name) 
	{
		$this->name = $name;
		return $this;
	}


	/**
	 * 'magic' debug info assembler
	 *
	 * @param string $name
	 * /
    public function __debugInfo() {
    	$result = get_object_vars($this);
    	//if ( isset($result["parent"]) )unset($result["parent"]);
    	return $result;
    } 
	 */
}

<commit_msg>Scrutinizer Auto-Fixes<commit_after><?php

namespace PHPagstract\Symbol\Symbols;

/**
 * abstract property symbol class
 *
 * @package   PHPagstract
 * @author    <NAME> <<EMAIL>>
 * @link      https://gitlab.bjoernbartels.earth/php/phpagstract
 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
 * @copyright copyright (c) 2016 <NAME> <<EMAIL>>
 */
abstract class AbstractPropertySymbol {
    
	/**
	 * symbol name
	 *
	 * @var Name
	 */
	private $name = 'Symbol';
    
	/**
	 * property type
	 *
	 * @var string
	 */
	private $type = null;

	/**
	 * parent symbol
	 * 
	 * @var Symbol
	 */
	private $parent;

	/**
	 * property container/reference
	 *
	 * @var \stdClass
	 */
	private $property = null;

	/**
	 * @param string $type
	 */
	public function __construct($type, $name, AbstractPropertySymbol & $parent = null) {
		if ($parent !== null) {
			$this->parent = & $parent;
		}
		$this->setName($name);
		$this->setType($type);
	}
    
	/**
	 * convert symbol data to array
	 *
	 * @return array
	 */
	public function serialize()
	{
		$result = get_object_vars($this);
		if (isset($result["parent"])) {
			unset($result["parent"]);
		}
		if (isset($result["items"])) {
			$items = [];
			foreach ($result["items"] as $key => $item) {
				$items[] = $item->serialize();
			}
			$result["items"] = $items;
		}
		if (isset($result["properties"])) {
			$properties = get_object_vars($result["properties"]);
			$items = [];
			foreach ($properties as $key => $item) {
				$items[$key] = $item->serialize();
			}
			$result["properties"] = (object) $items;
		}
		return $result;
	}
    
	//
	// get/set new property
	//
    
	/**
	 * get a property's value
	 * 
	 * @param string $property the property name
	 * @return mixed|NULL
	 */
	public function get($property) {
		if (isset($this->$property)) {
			return $this->$property;
		}
		return null;
	}
    
	/**
	 * set a property's value
	 * 
	 * @param string $property the property name
	 * @param mixed $value
	 * @return self
	 */
	public function set($property, $value) {
		$this->$property = $value;
		return $this;
	}
    
	//
	// getter/setters
	//

	/**
	 * get the property
	 *
	 * @return AbstractPropertySymbol
	 */
	public function getParent() 
	{
		if ($this->parent === null) {
			return $this;
		}
		return $this->parent;
	}
    
	/**
	 * set the property
	 *
	 */
	public function setParent(AbstractPropertySymbol $parent) 
	{
		$this->parent = $parent;
		return $this;
	}

	/**
	 * get the property
	 *
	 * @return \stdClass
	 */
	public function getProperty() 
	{
		return $this->property;
	}
    
	/**
	 * set the property
	 *
	 * @param mixed $property
	 */
	public function setProperty($property) 
	{
		$this->property = $property;
		return $this;
	}

	/**
	 * get the property type
	 *
	 * @return string
	 */
	public function getType() 
	{
		return $this->type;
	}
    
	/**
	 * set the property type
	 *
	 * @param string $type
	 */
	public function setType($type) 
	{
		$this->type = $type;
		return $this;
	}
    
	/**
	 * get the name
	 *
	 * @return string
	 */
	public function getName() 
	{
		return (string) $this->name;
	}
    
	/**
	 * set the name
	 *
	 * @param string $name
	 */
	public function setName($name) 
	{
		$this->name = $name;
		return $this;
	}


	/**
	 * 'magic' debug info assembler
	 *
	 * @param string $name
	 * /
    public function __debugInfo() {
    	$result = get_object_vars($this);
    	//if ( isset($result["parent"]) )unset($result["parent"]);
    	return $result;
    } 
	 */
}


{'fraction_non_alphanumeric': 0.170004260758415, 'fraction_numerical': 0.002272404487998864, 'mean_word_length': 2.613134940995382, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 53, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '5041633', 'n_tokens_mistral': 2682, 'n_tokens_neox': 2360, 'n_words': 560}