<commit_before><?php
/**
 * Created by PhpStorm.
 * User: vincenzotrapani
 * Date: 07/07/15
 * Time: 12:16
 */
namespace Amara\OneHydra\Object;

class PageObject {

	/** @var \stdClass */
	private $headContent;

	/** @var \stdClass */
	private $headInstructions;

	/** @var \stdClass */
	private $links;

	/** @var \stdClass */
	private $pageContent;

	/** @var  string */
	private $pageName;

	/** @var \stdClass */
	private $serverSide;

	CONST MAIN_LINKS_SECTION = 'main links';

	CONST RELEATED_LINKS_SECTION = 'releated links';

	/**
	 * @return \stdClass
	 */
	public function getHeadContent() {
		return $this->headContent;
	}

	/**
	 * @param mixed $headContent
	 * @return $this
	 */
	public function setHeadContent($headContent) {
		$this->headContent = $headContent;
		return $this;
	}

	/**
	 * @return \stdClass
	 */
	public function getHeadInstructions() {
		return $this->headInstructions;
	}

	/**
	 * @param mixed $headInstructions
	 * @return $this
	 */
	public function setHeadInstructions($headInstructions) {
		$this->headInstructions = $headInstructions;
		return $this;
	}

	/**
	 * @return \stdClass
	 */
	public function getLinks() {
		return $this->links;
	}

	/**
	 * @param mixed $links
	 * @return $this
	 */
	public function setLinks($links) {
		$this->links = $links;
		return $this;
	}

	/**
	 * @return \stdClass
	 */
	public function getPageContent() {
		return $this->pageContent;
	}

	/**
	 * @param mixed $pageContent
	 * @return $this
	 */
	public function setPageContent($pageContent) {
		$this->pageContent = $pageContent;
		return $this;
	}

	/**
	 * @return string
	 */
	public function getPageName() {
		return $this->pageName;
	}

	/**
	 * @param string $pageName
	 * @return $this
	 */
	public function setPageName($pageName) {
		$this->pageName = $pageName;

		return $this;
	}

	/**
	 * @return array
	 */
	public function getServerSide() {
		return $this->serverSide;
	}

	/**
	 * @param mixed $serverSide
	 * @return $this
	 */
	public function setServerSide($serverSide) {
		$this->serverSide = $serverSide;

		return $this;
	}

	/**
	 * @return array
	 */
	public function getMainLinks() {
		return $this->getLinkSection(PageObject::MAIN_LINKS_SECTION);
	}

	/**
	 * @return array
	 */
	public function getReleatedLinks() {
		return $this->getLinkSection(PageObject::RELEATED_LINKS_SECTION);
	}

	/**
	 * @param string $section
	 * @return array
	 */
	private function getLinkSection($section) {
		if (is_array($this->links)){
			foreach($this->links as $s) {
				if ($section === strtolower($s->Key)) {
					return $s->Value;
				}
			}
		}

		return [];
	}
}<commit_msg>Wrong section var<commit_after><?php
/**
 * Created by PhpStorm.
 * User: vincenzotrapani
 * Date: 07/07/15
 * Time: 12:16
 */
namespace Amara\OneHydra\Object;

class PageObject {

	/** @var \stdClass */
	private $headContent;

	/** @var \stdClass */
	private $headInstructions;

	/** @var \stdClass */
	private $links;

	/** @var \stdClass */
	private $pageContent;

	/** @var  string */
	private $pageName;

	/** @var \stdClass */
	private $serverSide;

	CONST MAIN_LINKS_SECTION = 'main links';

	CONST RELEATED_LINKS_SECTION = 'related links';

	/**
	 * @return \stdClass
	 */
	public function getHeadContent() {
		return $this->headContent;
	}

	/**
	 * @param mixed $headContent
	 * @return $this
	 */
	public function setHeadContent($headContent) {
		$this->headContent = $headContent;
		return $this;
	}

	/**
	 * @return \stdClass
	 */
	public function getHeadInstructions() {
		return $this->headInstructions;
	}

	/**
	 * @param mixed $headInstructions
	 * @return $this
	 */
	public function setHeadInstructions($headInstructions) {
		$this->headInstructions = $headInstructions;
		return $this;
	}

	/**
	 * @return \stdClass
	 */
	public function getLinks() {
		return $this->links;
	}

	/**
	 * @param mixed $links
	 * @return $this
	 */
	public function setLinks($links) {
		$this->links = $links;
		return $this;
	}

	/**
	 * @return \stdClass
	 */
	public function getPageContent() {
		return $this->pageContent;
	}

	/**
	 * @param mixed $pageContent
	 * @return $this
	 */
	public function setPageContent($pageContent) {
		$this->pageContent = $pageContent;
		return $this;
	}

	/**
	 * @return string
	 */
	public function getPageName() {
		return $this->pageName;
	}

	/**
	 * @param string $pageName
	 * @return $this
	 */
	public function setPageName($pageName) {
		$this->pageName = $pageName;

		return $this;
	}

	/**
	 * @return array
	 */
	public function getServerSide() {
		return $this->serverSide;
	}

	/**
	 * @param mixed $serverSide
	 * @return $this
	 */
	public function setServerSide($serverSide) {
		$this->serverSide = $serverSide;

		return $this;
	}

	/**
	 * @return array
	 */
	public function getMainLinks() {
		return $this->getLinkSection(PageObject::MAIN_LINKS_SECTION);
	}

	/**
	 * @return array
	 */
	public function getReleatedLinks() {
		return $this->getLinkSection(PageObject::RELEATED_LINKS_SECTION);
	}

	/**
	 * @param string $section
	 * @return array
	 */
	private function getLinkSection($section) {
		if (is_array($this->links)){
			foreach($this->links as $s) {
				if ($section === strtolower($s->Key)) {
					return $s->Value;
				}
			}
		}

		return [];
	}
}
{'fraction_non_alphanumeric': 0.15812535721089732, 'fraction_numerical': 0.0038102495713469233, 'mean_word_length': 3.251012145748988, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '2480373', 'n_tokens_mistral': 1984, 'n_tokens_neox': 1769, 'n_words': 388}