Conditionally marks a feature instance as canonical for a name

@param FeatureInterface $feature
332744
protected function storeToCanonical(FeatureInterface $feature)
    {
        $name = $feature->getName();
        $was  = $this->getFeature($name);
        $new  = $feature->resolve($was);

        $this->canonical[$name] = $new;

        if ($was !== $new) {
            $this->logger->debug('New canonical feature: {feature} from {provider}, {was} -> {new}', [
                'feature'  => $name,
                'provider' => $feature->getProvider()->getName(),
                'was'      => Status::$messages[$was->getStatus()],
                'new'      => Status::$messages[$this->canonical[$name]->getStatus()]
            ]);
        }
    }
141513
protected void invokeFeature(String featureSwitch, Feature feature ) {
        if(Config.getBooleanProperty(featureSwitch,true)) {
            feature.execute();
        }
    }
1150677
public function setProduct(ProductInterface $product)
    {
        $this->productId = $product->getId();
        $this->product = $product;
    }
1137551
protected function checkOptions(InputInterface $input): void
    {
        $errors  = [];
        $options = $this->getDefinition()->getOptions();
        foreach ($options as $option) {
            $name  = $option->getName();
            $value = $input->getOption($name);
            $this->checkOptionRequired($option, $value, $name, $errors);
            if (\is_array($value)) {
                foreach ($value as $v) {
                    $this->checkValueForEquals($v, $name, $errors);
                }
                continue;
            }
            $this->checkValueForEquals($value, $name, $errors);
        }
        if (count($errors) > 0) {
            throw new DoctrineStaticMetaException(implode("\n\n", $errors));
        }
    }
1144071
public function isSupported(string $feature): bool
    {
        if (!array_key_exists($feature, $this->supported)) {
            if (!isset($this->features[$feature])) {
                throw new UndefinedFeatureException($feature);
            }

            $this->supported[$feature] =
                (bool) $this->features[$feature]($this);
        }

        return $this->supported[$feature];
    }
1047524
protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) {
		String nameAsPropertyName = tryGetAsPropertyName(name.toString());
		if (nameAsPropertyName != null) {
			if (featureCall == null || featureCall instanceof XAssignment) {
				String aliasedSetter = "set" + nameAsPropertyName;
				acceptor.accept(aliasedSetter, 2);
			}
			if (!(featureCall instanceof XAssignment)) {
				if (featureCall == null || !getFeatureCall().isExplicitOperationCallOrBuilderSyntax()) {
					String aliasedGetter = "get" + nameAsPropertyName;
					acceptor.accept(aliasedGetter, 2);
					String aliasedBooleanGetter = "is" + nameAsPropertyName;
					acceptor.accept(aliasedBooleanGetter, 2);
				}
			}
		}
	}
885929
public function isFeatureEnabled($featureName)
    {
        try {
            $path = preg_split('/\./', $featureName);

            $foundValue = $this->findValueInMultiArray($path, $this->features);

            if (is_array($foundValue)) {
                return $this->checkEveryChild($foundValue);
            } else {
                return $foundValue;
            }
        } catch (\OutOfRangeException $e) {
            throw new FeatureNotDefinedException($featureName);
        }
    }
937649
public function consumed($feature)
    {
        foreach ($this->subscription->usage as $key => $usage) {
            if ($usage->code === $feature and $usage->isExpired() == false) {
                return $usage->used;
            }
        }

        return 0;
    }
205340
public int ensureFeature(String featureName) {
        int feature = featureToIndex.getOrDefault(featureName, -1);
        if (feature == -1) {
            synchronized (featureToIndex) {
                feature = featureToIndex.getOrDefault(featureName, -1);
                if (feature == -1) {
                    feature = featureToIndex.size();
                    featureToIndex.put(featureName, feature);
                }
            }
        }
        return feature;
    }
1231472
public function isFeatureMatch(FeatureNode $feature)
    {
        if ('/' === $this->filterString[0]) {
            return 1 === preg_match($this->filterString, $feature->getTitle());
        }

        return false !== mb_strpos($feature->getTitle(), $this->filterString, 0, 'utf8');
    }
1195527
public function remove($feature)
    {
        $this->storage->remove($this->key($feature));

        $features = $this->features();
        if (in_array($feature, $features)) {
            $features = array_diff($features, array($feature));
        }
        $this->storage->set($this->featuresKey(), implode(',', $features));
    }
556415
public function add(PropertyInterface $property)
    {
        $iri = $property->toIri();

        // Create the property values list if necessary
        if (!$this->offsetExists($iri)) {
            $this->offsetSet($iri, [$property]);
            return;
        }

        $propertyStore =& $this->offsetGet($iri);
        $propertyStore[] = $property;
    }
168628
public function update(FeaturesRequest $request, Feature $feature)
    {
        if ($request->has('name') && $feature->name != $request->get('name')) {
            event(new FeatureNameWasUpdated($feature, $request->get('name')));
        }

        $feature->update(
            $request->except('name')
        );

        return redirect()->route('features.edit', $feature)->with('status', trans('globals.success_text'));
    }
336434
private static function mandatory($feature) {
        if ($feature->getParent() && $feature->getMandatory())
            return Logic::equiv(Logic::is($feature), Logic::is($feature->getParent()));
    }
446871
public function setFeature(\Dywee\ProductBundle\Entity\Feature $feature = null)
    {
        $this->feature = $feature;

        return $this;
    }
406752
public function isActive($featureName, DeterminableUserInterface $user = null)
    {
        $feature = $this->getFeature($featureName);
        return $feature->isActive($this, $user);
    }
1208982
public function setProperty(PropertyInterface $property)
    {
        $this->property      = $property;
        $this->propertyType  = $property->type();
        $this->propertyIdent = $property->ident();

        $inputType = $property['input_type'];
        if ($inputType) {
            $this->inputType = $inputType;
        }

        $displayType = $property['display_type'];
        if ($displayType) {
            $this->displayType = $displayType;
        }

        return $this;
    }