Notify any observers about state change.

@param null|int $state
342029
public function notify($state = null)
	{
		assert($state === null || is_int($state));
		$this->_state = intval($state) ?: $this->_state;

		/** @var \SplObserver $observer */
		foreach ($this->_observers as $observer)
		{
			$observer->update($this);
		}
	}
648367
protected function checkState(string $state = null):void{

		if(empty($state) || !$this->storage->hasCSRFState($this->serviceName)){
			throw new ProviderException('invalid state for '.$this->serviceName);
		}

		$knownState = $this->storage->getCSRFState($this->serviceName);

		if(!hash_equals($knownState, $state)){
			throw new ProviderException('invalid CSRF state: '.$this->serviceName.' '.$state);
		}

	}
356432
function setState($state) {
		if($state == (self::WINDOW_DOOR_SENSOR_STATE_OPEN or self::WINDOW_DOOR_SENSOR_STATE_CLOSED))
			$this->state = $state;
		else
			throw new \Exception('Invalid WindowDoorSensor state "'.$state.'"');
	}
1313004
public function setState($state)
	{
		if ( $state == $this->getState() ) { return; }

		$this->_values['state'] = (string) $state;
		$this->setModified();
	}
331209
public function setState($state)
    {
        $state &= ~248; // 0b11111000

        if (($state & ($state - 1)) !== 0) {
            throw new InvalidArgumentException("State must be a valid state value");
        }

        $this->setFlags($state);
        $this->streamCallback = null;
    }
496022
public function setCheck($check, $state)
    {
        if (array_key_exists($check, $this->meta->checks))
        {
            $this->meta->checks[$check] = $state;
        }
    }
18406
private static function _debug($state=null)
	{
		static $_ = true;

		// set
		//
		if (isset($state))
		{
			$_ = (boolean) $state;
		}

		// get
		//
		return $_;
	}
758610
public void setState(PrimitiveState state) {
    if (this.state != state) {
      if (this.state != PrimitiveState.EXPIRED && this.state != PrimitiveState.CLOSED) {
        this.state = state;
        if (state == PrimitiveState.SUSPENDED) {
          if (suspendedTime == null) {
            suspendedTime = System.currentTimeMillis();
          }
        } else {
          suspendedTime = null;
        }
        changeListeners.forEach(l -> l.accept(state));
      }
    } else if (this.state == PrimitiveState.SUSPENDED) {
      if (System.currentTimeMillis() - suspendedTime > timeout) {
        setState(PrimitiveState.EXPIRED);
      }
    }
  }
1239156
protected void notifyChangeListeners() {
        ChangeEvent e = new ChangeEvent(this);
        for (ChangeListener l : changeListeners) {
            l.stateChanged(e);
        }
    }
797509
private function stateChanged($states)
    {
        $appID = App::getCurrentID();
        $complementID = self::getCurrentID();

        if (isset($states[$appID][$complementID])) {
            $actualStates = $states[$appID][$complementID];

            if (! count(array_diff_assoc($actualStates, $this->states))) {
                return false;
            }
        }

        return true;
    }
1277617
public function notify()
    {
        \BFW\Application::getInstance()
            ->getMonolog()
            ->getLogger()
            ->debug(
                'Subject notify event',
                ['action' => $this->action]
            );
        
        foreach ($this->observers as $observer) {
            $observer->update($this);
        }
    }
1269582
public function notify() {
        foreach($this->watchers as $watcher) {
          if ($this->stopNotify === true) {
              break;
          }

          $watcher->update($this);
        }
    }
650282
void notifyStateTransition(Execution execution, ExecutionState newState, Throwable error) {
		// only forward this notification if the execution is still the current execution
		// otherwise we have an outdated execution
		if (currentExecution == execution) {
			getExecutionGraph().notifyExecutionChange(execution, newState, error);
		}
	}
981718
private synchronized void changeState(PrimitiveState state) {
    if (this.state != state) {
      this.state = state;
      stateChangeListeners.forEach(l -> threadContext.execute(() -> l.accept(state)));
    }
  }
220910
public void changeState(Class<? extends State> next)
    {
        Check.notNull(next);

        final State from = current;
        if (current != null)
        {
            last = current.getClass();
            current.exit();
        }
        if (!states.containsKey(next))
        {
            final State state = create(next);
            states.put(next, state);
        }
        current = states.get(next);
        current.enter();

        listeners.forEach(l -> l.notifyStateTransition(from != null ? from.getClass() : null, next));
    }
211081
public function notifyObservers($arg = null)
    {
        if ($this->hasChanged()) {
            foreach ($this->getObserverSetObject() as $observerObject) {
                $observerObject->update($this, $arg);
            }
            $this->clearChanged();
        }
    }
250969
function setState($state) {
		if($state == (self::GENERIC_ACTUATOR_STATE_ON or self::GENERIC_ACTUATOR_STATE_OFF))
			$this->state = $state;
		else
			throw new \Exception('Invalid GenericActuator state "'.$state.'"');
	}