Get validation schemas name.

@param  string  $scenario

@return array
768793
protected function getValidationSchemasName(string $scenario): array
    {
        $scenario = \ucfirst($scenario);

        $on = "on{$scenario}";
        $extend = "extend{$scenario}";

        return [
            \method_exists($this, $on) ? $on : null,
            \method_exists($this, $extend) ? $extend : null,
        ];
    }
98133
public function getSchemaDataDefaults()
    {
        $schema = parent::getSchemaDataDefaults();
        $schema['data'] = array_merge($schema['data'], [
            'showLinkText' => $this->getShowLinkText(),
            'linkedPage' => $this->getLinkPage() ? $this->getLinkPage()->toMap() : [],
            'title' => $this->Title(),
        ]);
        return $schema;
    }
625645
protected function validateProperties($entity, $schema, $entityName)
    {
        $properties = get_object_vars($entity);

        if (!isset($schema->properties)) {
        	return $this;
            //throw new SchemaException(sprintf('No properties defined for [%s]', $entityName));
        }

        // Check defined properties
        foreach($schema->properties as $propertyName => $property) {
            if (array_key_exists($propertyName, $properties)) {
                // Check type
                $path = $entityName . '.' . $propertyName;
                $this->validateType($entity->{$propertyName}, $property, $path);
            } else {
                // Check required
                if (isset($property->required) && $property->required) {
                    throw new ValidationException(sprintf('Missing required property [%s] for [%s]', $propertyName, $entityName));
                }
            }
        }

        // Check additional properties
        if (isset($schema->additionalProperties) && !$schema->additionalProperties) {
            $extra = array_diff(array_keys((array)$entity), array_keys((array)$schema->properties));
            if (count($extra)) {
                throw new ValidationException(sprintf('Additional properties [%s] not allowed for property [%s]', implode(',', $extra), $entityName));
            }
        }

        return $this;
    }
579777
public function getSchemaFilename($settings)
    {
        // Default
        $schemaFile = sprintf('%s/%s', getcwd(), 'schema.php');
        if (!empty($settings['schema_file'])) {
            $schemaFile = $settings['schema_file'];
        }

        return $schemaFile;
    }
827272
protected function _validateSlug($instance)
    {
        $slug = $instance->get('eav_attribute')->get('name');
        $columns = $this->_table->schema()->columns();
        if (in_array($slug, $columns)) {
            $instance->get('eav_attribute')->errors('name', __d('field', 'The name "{0}" cannot be used as it collides with table column names.', $slug));
        }
    }
376780
public function getValidation($field = null)
    {

        $validation = array();
        $schema = $this->getModelSchema();

        if ($field != null)
            $schema = array($field => $schema[$field]);

        foreach ( $schema as $key => $value ) {
            if (!isset($value['validation']))
                throw new Exception('Validation missing for key: '.$field);
            $validation[$key] = $value['validation'];
        }

        if ($field != null)
            return $validation[$field];

        return $validation;
    }
1171733
private function getMixinSchemas(SchemaDescriptor $schema)
    {
        $schemaIds = [];

        foreach ($schema->getMixins() as $mixin) {
            $schemaIds[] = $mixin->getId()->getCurieWithMajorRev();

            $schemaIds = array_merge(
                $schemaIds,
                $this->getExtendsSchemas($mixin),
                $this->getMixinSchemas($mixin)
            );
        }

        return $schemaIds;
    }
1214528
public function format(OutlineNode $scenario)
    {
        if (! $scenario->hasExamples()) {
            return;
        }

        // TODO: refactor this part
        return implode(
            array_merge(
                [
                    $this->indent(self::INDENTATION * 2) . rtrim($scenario->getExampleTable()->getKeyword()) . ":\n",
                ],
                array_map(
                    function ($arguments) {
                        return $this->indent(self::INDENTATION * 2 + 2) . trim($arguments) . "\n";
                    },
                    explode("\n", $scenario->getExampleTable()->getTableAsString())
                )
            )
        );
    }
272745
public function schemas($schemaName = null)
    {
        if (is_null($schemaName)) {
            $url = $this->url('schema-list');
            return $this->request('get', $url);
        }

        return $this->schema($schemaName);
    }
11496
public function isScenarioMatch(ScenarioInterface $scenario)
    {
        if ('/' === $this->filterString[0] && 1 === preg_match($this->filterString, $scenario->getTitle())) {
            return true;
        } elseif (false !== mb_strpos($scenario->getTitle(), $this->filterString, 0, 'utf8')) {
            return true;
        }

        return false;
    }
26322
private function extractFieldType($spec)
    {
        if (!preg_match('/(\w+)(?:\s*\(\s*([0-9]+)(?:\,\s*([0-9]+))?\s*\))?(?:\s*(\w+))?/s', strtoupper($spec), $match)) {
            return [null, null, null, null];
        }

        $dbType   = isset($match[1]) ? $match[1] : null;
        $size     = isset($match[2]) && $match[2] != '' ? (int)$match[2] : null;
        $scale    = isset($match[3]) && $match[2] != '' ? (int)$match[3] : null;
        $unsigned = isset($match[4]) && $match[4] == 'UNSIGNED';

        return [$dbType, $size, $scale, $unsigned];
    }
944612
public function validateMapping()
    {
        try {
            $validator = new SchemaValidator($this->entityManager);
            return $validator->validateMapping();
        } catch (\Exception $exception) {
            return [[$exception->getMessage()]];
        }
    }
780300
private function getAndValidateServiceSchema($id)
    {
        $schema = $this->schema[$id];

        if (null === $schema) {
            $schema = array('class' => $id);
        }

        if (is_string($schema)) {
            $schema = array('class' => $schema);
        }

        $schema['class'] = $this->getAndValidateClass($id, $schema);
        $schema['arguments'] = $this->getAndValidateArguments($schema);

        return $schema;
    }
1006324
public static function contextName($project, $session, $context)
    {
        return self::getContextNameTemplate()->render([
            'project' => $project,
            'session' => $session,
            'context' => $context,
        ]);
    }
301328
public static function fromTableSchema(TableSchema $schema)
    {
        $properties = [];
        $required = [];
        foreach ($schema->getColumns() as $column) {
            if ($column->getRequired()) {
                $required[] = $column->getName();
            }

            $properties[$column->getName()] = static::fromColumnSchema($column);
        }

        return [
            'type'       => 'object',
            'required'   => $required,
            'properties' => $properties
        ];
    }
266760
protected function resolveFieldName($prop): ?string
    {
        /** @var Annotation\Field $annotation */
        if (($annotation = $this->getFieldAnnotation($prop, Annotation\Field::class)) && $annotation->name) {
            return $annotation->name;
        }

        if ($prop instanceof \ReflectionMethod) {
            if ($methodName = lcfirst(preg_replace('/^(get|set|has|is)/', null, $prop->name))) {
                return $methodName;
            }
        }

        return $prop->name;
    }
860783
private function validateSchema(Schema $schema)
    {
        $this->jsonValidator->check(
            json_decode(json_encode($schema->jsonSerialize())),
            json_decode(file_get_contents($schema->getSchema()))
        );

        return $this->jsonValidator->isValid();
    }