MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / activeAttributes

Method activeAttributes

benches/fixtures/yii/Model.php:813–828  ·  view source on GitHub ↗

* Returns the attribute names that are subject to validation in the current scenario. * @return string[] safe attribute names */

()

Source from the content-addressed store, hash-verified

811 * @return string[] safe attribute names
812 */
813 public function activeAttributes()
814 {
815 $scenario = $this->getScenario();
816 $scenarios = $this->scenarios();
817 if (!isset($scenarios[$scenario])) {
818 return [];
819 }
820 $attributes = array_keys(array_flip($scenarios[$scenario]));
821 foreach ($attributes as $i => $attribute) {
822 if (strncmp($attribute, '!', 1) === 0) {
823 $attributes[$i] = substr($attribute, 1);
824 }
825 }
826
827 return $attributes;
828 }
829
830 /**
831 * Populates the model with input data.

Callers 3

validateMethod · 0.95
getActiveValidatorsMethod · 0.95
isAttributeActiveMethod · 0.95

Calls 2

getScenarioMethod · 0.95
scenariosMethod · 0.95

Tested by

no test coverage detected