<commit_before><?php

/**
 * ModalReveal.php (UTF-8)
 * Copyright (c) 2014 <NAME> <<EMAIL>>
 */

namespace Sphp\Html\Foundation\F6\Containers\Modals;

use Sphp\Html\ContainerTag as ContainerTag;
use Sphp\Html\Navigation\HyperlinkInterface as HyperlinkInterface;

/**
 * Class implements Foundation Reveal Modal 
 * 
 * Modal dialogs, or pop-up windows, are handy for prototyping and production.
 *
 * @author  <NAME> <<EMAIL>>
 * @since   2014-03-25
 * @link    http://foundation.zurb.com/ Foundation 6
 * @link    http://foundation.zurb.com/docs/components/reveal.html Founfation Reveal
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPLv3
 * @filesource
 */
class Controller extends ContainerTag implements \Sphp\Html\Attributes\AttributeChangeObserver {

  /**
   * the Modal reveal controller
   *
   * @var ModalReveal
   */
  private $modal;

  /**
   * Constructs a new instance
   *
   * **Important!**
   *
   * Parameter `$content` can be of any type that converts to a
   * string or to an array of strings. So also an object of any class
   * that implements magic method `__toString()` is allowed.
   * 
   * @param mixed $content the content of the component
   * @param ModalReveal $modal
   */
  public function __construct(ModalReveal $modal, $content = null) {
    parent::__construct("a", $content);
    $this->attrs()->demand("data-open");
    $this->setTarget($modal);
  }

  private function setTarget(ModalReveal $modal) {
    $this->attrs()->set("data-open", $modal->getId());
    $modal->attachAttributeChangeObserver($this);
    $this->modal->detachAttributeChangeObserver($this);
    $this->modal = $modal;
    return $this;
  }

  public function attributeChanged(\Sphp\Html\Attributes\AttributeChanger $obj, $attrName) {<commit_msg>Misc updates<commit_after><?php

/**
 * ModalReveal.php (UTF-8)
 * Copyright (c) 2014 <NAME> <<EMAIL>>
 */

namespace Sphp\Html\Foundation\F6\Containers\Modals;

use Sphp\Html\ContainerTag as ContainerTag;
use Sphp\Html\Navigation\HyperlinkInterface as HyperlinkInterface;

/**
 * Class implements Foundation Reveal Modal 
 * 
 * Modal dialogs, or pop-up windows, are handy for prototyping and production.
 *
 * @author  <NAME> <<EMAIL>>
 * @since   2014-03-25
 * @link    http://foundation.zurb.com/ Foundation 6
 * @link    http://foundation.zurb.com/docs/components/reveal.html Founfation Reveal
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPLv3
 * @filesource
 */
class Controller extends ContainerTag implements \Sphp\Html\Attributes\AttributeChangeObserver {

  /**
   * the Modal reveal controller
   *
   * @var ModalReveal
   */
  private $modal;

  /**
   * Constructs a new instance
   *
   * **Important!**
   *
   * Parameter `$content` can be of any type that converts to a
   * string or to an array of strings. So also an object of any class
   * that implements magic method `__toString()` is allowed.
   * 
   * @param mixed $content the content of the component
   * @param ModalReveal $modal
   */
  public function __construct(ModalReveal $modal, $content = null) {
    parent::__construct("a", $content);
    $this->attrs()->demand("data-open");
    $this->setTarget($modal);
  }

  private function setTarget(ModalReveal $modal) {
    $this->attrs()->set("data-open", $modal->getId());
    $modal->attachAttributeChangeObserver($this);
    if ($this->modal !== null) {
      $this->modal->detachAttributeChangeObserver($this);
    }
    $this->modal = $modal;
    return $this;
  }

  public function attributeChanged(\Sphp\Html\Attributes\AttributeChanger $obj, $attrName) {
{'fraction_non_alphanumeric': 0.1365416899832121, 'fraction_numerical': 0.010072747621712367, 'mean_word_length': 3.64889466840052, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 36, 'https://': 0, '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': '5395897', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1116, 'n_words': 284}