Analyses the instance. Returns array() if everything is alright, or an array of error messages.
Analysis performed:
- The compulsory fields in the constructor are indeed filled.

@return string[]
359286
public function validate() {
		$errors = array();
		if ($this->getType() == self::TYPE_DECLARATIVE) {
			$classDescriptor = $this->getClassDescriptor();
			$constructor = $classDescriptor->getConstructor();
			
			if ($constructor) {
				$params = $constructor->getParameters();
				
				$i=0;
				
				foreach ($params as $param) {
					/* @var $param MoufReflectionParameter */
					if (!$param->isOptional()) {
						if (!$this->moufManager->isParameterSetForConstructor($this->getIdentifierName(), $i)) {
							$name = $this->getIdentifierName();
							if ($this->isAnonymous()) {
								$name = "anonymous instance of class ".$this->getClassName();
							}
							$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is compulsory.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
						} elseif (!$param->allowsNull()) {
							$name = $this->getIdentifierName();
							if ($this->isAnonymous()) {
								$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
							}
							if ($this->moufManager->getParameterForConstructor($this->getIdentifierName(), $i) === null) {
								$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is null, but the constructor signature does not allow it to be null.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
							}
						}
					}
					if ($this->moufManager->getParameterTypeForConstructor($this->getIdentifierName(), $i) == 'php') {
						$name = $this->getIdentifierName();
						// Ok, we need to check the code.
						$code = $this->moufManager->getParameterForConstructor($name, $i);
						try {
							CodeValidatorService::validateCode($code);
						} catch (Error $e) {
							if ($this->isAnonymous()) {
								$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
							}
							$errors[] = "In instance <em>".$name."</em>, the constructor
									parameter '".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
									<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
						}
					}		
					$i++;
				}
			}
			
			foreach ($classDescriptor->getInjectablePropertiesByPublicProperty() as $propertyName=>$moufProperty) {
				$property = $this->getPublicFieldProperty($propertyName);
				if ($property->getOrigin() == 'php') {
					$code = $property->getValue();
					try {
						CodeValidatorService::validateCode($code);
					} catch (Error $e) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
						$errors[] = "In instance <em>".$name."</em>, the public property
									'".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
													<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				}
			}
			
			foreach ($classDescriptor->getInjectablePropertiesBySetter() as $propertyName=>$moufProperty) {
				$property = $this->getSetterProperty($propertyName);
				if ($property->getOrigin() == 'php') {
					$code = $property->getValue();
					try {
						CodeValidatorService::validateCode($code);
					} catch (Error $e) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
						$errors[] = "In instance <em>".$name."</em>, the setter
									'".$param->getName()."' is using PHP code that contains a parse error: <em>{$e->getMessage()}</em>.
											<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				}
			}
			
			// Now, let's check that the MoufManager instance definition is not using properties that where once declared
			// but that no longer exist in the class:
			
			$definedPublicProperties = $this->moufManager->getParameterNames($this->name);
			if ($definedPublicProperties) {
				$missingPublicProperties = array_diff($definedPublicProperties, array_keys($classDescriptor->getInjectablePropertiesByPublicProperty()));
				foreach ($missingPublicProperties as $missingPublicPropertyName) {
					$name = $this->getIdentifierName();
					if ($this->isAnonymous()) {
						$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
					}
					
					$errors[] = "In instance <em>".$name."</em>, the public property
								'".$missingPublicPropertyName."' is declared but does not exist. It is likely it once existed but was renamed or removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
			}
			
			$definedSetters = $this->moufManager->getParameterNamesForSetter($this->name);
			if ($definedSetters) {
				$missingSetters = array_diff($definedSetters, array_keys($classDescriptor->getInjectablePropertiesBySetter()));
				foreach ($missingSetters as $missingSetterName) {
					$name = $this->getIdentifierName();
					if ($this->isAnonymous()) {
						$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
					}
				
					$errors[] = "In instance <em>".$name."</em>, the setter
								'".$missingSetterName."()' is declared but does not exist. It is likely it once existed but was renamed or removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
			}
			
			$definedConstructorArguments = $this->moufManager->getParameterNamesForConstructor($this->name);
			if ($definedConstructorArguments) {
				$constructor = $classDescriptor->getConstructor();
				if ($constructor) {
					$nbParameters = $classDescriptor->getConstructor()->getNumberOfParameters();
					$missingConstructorArguments = array_filter($definedConstructorArguments, function($nb) use ($nbParameters) { return $nbParameters <= $nb; });
					foreach ($missingConstructorArguments as $missingArgument) {
						$name = $this->getIdentifierName();
						if ($this->isAnonymous()) {
							$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
						}
					
						$errors[] = "In instance <em>".$name."</em>, the constructor argument
								n°".$missingArgument." is used but does not exist. It is likely it once existed but was removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
					}
				} else {
					$name = $this->getIdentifierName();
					$errors[] = "In instance <em>".$name."</em>, parameters are injected in the constructor but the constructor does not exist. It is likely it once existed but was removed.
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
				}
				
				
			}
				
		} else {
			$error = $this->moufManager->getErrorOnInstanceCode($this->getIdentifierName());
			if ($error) {
				$name = $this->getIdentifierName();
				if ($this->isAnonymous()) {
					$name = "anonymous instance from class <strong>".$this->getClassName()."</strong>";
				}
				$errors[] = "The instance <em>".$name."</em> is declared by PHP code and is throwing an error message:
								$error
										<a href='".MOUF_URL."ajaxinstance/?name=".urlencode($this->getIdentifierName())."' class='btn btn-success'><i class='icon-pencil icon-white'></i> Edit</a>";
			}
		}
		return $errors;
	}
509025
final public static function all() : array
    {
        static $all = null;

        if ($all === null) {
            foreach ((new \ReflectionClass(get_called_class()))->getConstants() as $constant) {
                $all[] = new static($constant);
            }
        }

        return $all;
    }
940803
public function getErrorList(): array
    {
        $errorList = $this->errorList;
        foreach ($this->fieldResultList as $fieldResult) {
            foreach ($fieldResult->getErrorList() as $error) {
                $errorList[] = $error;
            }
        }

        return $errorList;
    }
122525
public function getUnloadedAspects(): array
    {
        $unloadedAspects = [];

        foreach ($this->container->getByTag('aspect') as $aspect) {
            if (!isset($this->loadedAspects[get_class($aspect)])) {
                $unloadedAspects[] = $aspect;
            }
        }

        return $unloadedAspects;
    }
309157
public function getMessages()
    {
        if ($this->invalidDataTypeException !== null) {
            return array(
                'invalidType' => sprintf(
                    'Value must be an array or Traversable object; received %s',
                    is_object($this->invalidData) ? get_class($this->invalidData) : gettype($this->invalidData)
                )
            );
        }

        return parent::getMessages();
    }
920451
private function privateErrors() : array
    {
        $errors = [];
        if (isset($this->tests)) {
            foreach ($this->tests as $error => $test) {
                if (!$test((array)$this)) {
                    $errors[] = $error;
                }
            }
        }
        return $errors;
    }
443362
public function getFieldsMessagesDataAttributes()
    {
        $result = [];
        $formConfiguration = $this->getFormObject()->getConfiguration();
        $formResult = $this->getFormObject()->getFormResult();

        foreach ($formResult->getSubResults() as $fieldName => $fieldResult) {
            if (true === $formConfiguration->hasField($fieldName)
                && false === $formResult->fieldIsDeactivated($formConfiguration->getField($fieldName))
            ) {
                $result += $this->getFieldErrorMessages($fieldName, $fieldResult);
                $result += $this->getFieldWarningMessages($fieldName, $fieldResult);
                $result += $this->getFieldNoticeMessages($fieldName, $fieldResult);
            }
        }

        return $result;
    }
829665
public function toArray()
    {
        return [
            'message' => $this->getMessageException(),
            'errors' => $this->getErrors(),
            'debugCode' => $this->getDebugCode(),
            'details' => $this->getDetails(),
            'routeBack' => redirect()->back()->getTargetUrl()
        ];
    }
544518
public function errorMessages()
    {
        $messages = array();

        // Loop over each field
        foreach ($this->errors as $field => $errors) {
            $messages[$field] = array();

            // Loop over the fields errors
            foreach ($errors as $validation => $error) {
                $vars = array_merge(
                    array('field' => Language::translate($field)),
                    $error
                );
                unset($vars['message']);
                $messages[$field][] = Language::translate($error['message'], $vars);
            }
        }

        return $messages;
    }
566320
public function getValidationMessage(): array{
        $fields = [];
        foreach ($this->validations as $validation) {
            /* @var Validation $validation */
            if ($validation->getStatus() == Validation::ERROR) {
                if (!isset($fields[$validation->getField()])) {
                    $fields[$validation->getField()] = [];
                }
                var_dump($validation->getMessage());
                array_push($fields[$validation->getField()], $validation->getMessage());
            }
        }
        return $fields;
    }
1312490
private function parseArray()
    {
        $length = $this->parseUnsignedInt32();
        $stopAt = strlen($this->buffer) - $length;
        $array = [];

        while (strlen($this->buffer) > $stopAt) {
            $array[] = $this->parseField();
        }

        return $array;
    }
1319707
public function getMessages()
    {
        $messages = array();
        foreach ($this->_fields as $fieldName => $values) {
            if (! $values['isValid']) {
                $invalidators = array();
                foreach ($values['validators'] as $validatorName => $validatorValue) {
                    if (! $validatorValue) {
                        $invalidators[] = $validatorName;
                    }
                }
                $messages[$fieldName] = $invalidators;
                unset($validator);
            }
            unset($fieldName);
            unset($values);
        }
        return $messages;
    }
45258
public function toArray(): array
    {
        return [
            "clientFilename" => $this->getClientFilename(),
            "unverifiedContentType" => $this->error ? "" : $this->getContentType(true),
            "verifiedContentType" => $this->error ? "" : $this->getContentType(),
            "size" => $this->error ? 0 : $this->getSize(),
            "tempPath" => $this->error ? "" : $this->getTempPath(),
            "error" => $this->error ? $this->error->getMessage() : "",
        ];
    }
533407
final public function toArray()
    {
        $this->checkRequiredFields();

        $fields = get_object_vars($this);

        $array = [];
        foreach ($fields as $field => $value) {
            $array[$field] = $this->transformToArray($this->getAttribute($field));
        }

        return $array;
    }
791079
public function toArray()
    {
        return [
            'severity' => $this->severity,
            'msg' => $this->msg,
            'hint' => $this->hint,
            'link' => !empty($this->link) ? $this->link : null,
            'iconCls' => $this->iconClass,
        ];
    }
1243398
public function getFirstErrors(): array
    {
        $errors = $this->getErrors();
        if (empty($errors)) {
            return [];
        } else {
            $errors = [];
            foreach ($errors as $name => $es) {
                if (!empty($es)) {
                    $errors[$name] = reset($es);
                }
            }

            return $errors;
        }
    }
399953
public function getValidationErrors()
    {
        $errors = [];
        if (isset($this->response->errors)) {
            foreach ($this->response->errors as $error => $reasons) {
                $errors[] = [
                    'attribute' => $error,
                    'reason'    => $this->getValidationReasonsAsString($reasons),
                ];
            }
        }

        return $errors;
    }