Add theme supports to WP.

@param string        $key
@param array|boolean $props
556854
public function addRemoveThemeSupport($key, $props = [])
    {
        // Setup theme
        add_action('after_setup_theme', function () use ($key, $props) {
            // Check props
            if (is_bool($props) && !$props) {
                // Remove theme support
                remove_theme_support($key);
            } else if (empty($props)) {
                // Add theme support with default configuration
                add_theme_support($key);
            } else {
                // Add theme support with configurations
                add_theme_support($key, $props);
            }
        });
    }
551349
public function has(?string $key) : bool
    {
        return $key === null ? false : isset($this->themes[$key]);
    }
1282022
private function resolveCustom($key)
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->resolveCustom($k);
            }
        } else {
            if (! in_array($key, $this->reserved)) {
                $this->customFields[] = $key;
            }
        }
    }
1203737
public function themeIsDefault($key = null) : bool
    {
        if ($key instanceof Theme) {
            return $key->getKey() === $this->getDefaultTheme()->getKey();
        }

        return $this->getTheme($key)->getKey() === $this->getDefaultTheme()->getKey();
    }
107752
function applyDefaults (array $props)
  {
    $this->beingAssigned = $props;
    foreach ($props as $k => $v)
      if (!$this->isModified ($k))
        $this->set ($k, $v);
  }
1231525
public function remove_after_theme_row( $theme_key, $theme ) {
		$themes = $this->get_theme_configs();

		foreach ( static::$git_servers as $server ) {
			$repo_header = $server . ' Theme URI';
			$repo_uri    = $theme->get( $repo_header );

			/**
			 * Filter to add themes not containing appropriate header line.
			 *
			 * @since   5.4.0
			 * @access  public
			 *
			 * @param array $additions Listing of themes to add.
			 *                         Default null.
			 * @param array $themes    Listing of all themes.
			 * @param         string        'theme'    Type being passed.
			 */
			$additions = apply_filters( 'github_updater_additions', null, $themes, 'theme' );
			foreach ( (array) $additions as $addition ) {
				if ( $theme_key === $addition['slug'] ) {
					if ( ! empty( $addition[ $server . ' Theme URI' ] ) ) {
						$repo_uri = $addition[ $server . ' Theme URI' ];
						break;
					}
				}
			}
			if ( empty( $repo_uri ) ) {
				continue;
			}
			break;
		}
		if ( array_key_exists( $theme_key, $themes ) ) {
			remove_action( "after_theme_row_$theme_key", 'wp_theme_update_row' );
		}
	}
302637
protected function setKeyInEnvironmentFile($key)
    {
        $currentKey = $this->laravel['config']['app.key'];

        if (strlen($currentKey) !== 0 && (! $this->confirmToProceed())) {
            return false;
        }

        $this->writeNewEnvironmentFileWith($key);

        return true;
    }
516547
protected function addGlobal(string $key, $value)
    {
        $template = $this->getContext()->getTemplateEngine();
        $template->addGlobal($key, $value);
    }
1008518
protected function addWhereIn(string $key, array $values, bool $not = false): void
    {
        $placeholders = [];
        foreach ($values as $value) {
            $placeholder = $this->addBindingValue($key, $value);
            array_push($placeholders, $placeholder);
        }
        $placeholdersList = implode(',', $placeholders);
        $pattern = ($not === true) ? '%s NOT IN (%s)' : '%s IN (%s)';

        $key = $this->quoteName($key);
        $this->statement .= sprintf($pattern, $key, $placeholdersList);
        $this->statement .= PHP_EOL;
    }
1154305
protected function addGroup(string $key) : HtmlContainer
    {
        $group = (new HtmlContainer('<optgroup>'))
            ->addAttribute('label', $key);

        $this->allOptions['group-' . $key] = $group;

        return $group;
    }
843644
protected function addProperties($props)
    {
        $this->resolveAllProperties($props);
        foreach ($props->keys() as $name) {
            $value = $props->getProperty($name);
            $v = $this->project->replaceProperties($value);
            if ($this->prefix !== null) {
                $name = $this->prefix . $name;
            }
            $this->addProperty($name, $v);
        }
    }
1212528
private function updateMessageTemplate( $template, $key ) {    
        //invalide message key
        if( !key_exists( $messageKey, $this->templates ) && $key != self::DEFAULT_KEY )
            throw new Exception\MessageTemplateDoesNotExist( "A message template does not exist for key $messageKey" );

        $this->templates[$key] = $template;
    }
713783
protected function insert($key)
    {
        if ($this->after($key) === null || $this->after($key) === '') {
            return false;
        }

        $this->differ->setRenderer(new Renderers\Insert);

        $value = $this->before($key)
                    ? $this->differ->render($this->before($key), $this->after($key))
                    : $this->after($key);

        $diff = [
            'key' => $key,
            'value' => $value,
            'type' => 'insert',
        ];

        return (object) $diff;
    }
65187
protected function updateProps( $props )
    {
        $this->log( "Storing new props: " . var_export( $props, true ), LogLevel::DEBUG );
        $this->props = $props;   
    }
1306084
protected function addHelpResource($key, $resource)
    {
        if (isset($this->helpResources[$key])) {
            throw new \LogicException('The resource you are trying to add is already set.');
        }

        if (false === is_object(($resource))) {
            throw new \InvalidArgumentException(sprintf('The resource "%s" you are trying to add is not an object. addHelpResource() accepts only objects. Use addHelpValue() to store other kind of values.', $key));
        }

        $this->helpResources[$key] = $resource;

        return $this;
    }
1001630
public function update($props)
    {
    
        if (isset($props['permissions'])) {
            $this->updatePermissions($props['permissions']);
            unset($props['permissions']);
        }
        
        if (isset($props['fields'])) {
            $this->updateFields($props['fields']);
            unset($props['fields']);
        }        
    
        $this->fields = $props;        
        $this->save();       
    }
1335451
function apply (array $props)
  {
    $this->beingAssigned = $props;
    foreach ($props as $k => $v)
      $this->set ($k, $v);
  }