public function addProblem(
        $definitionSource,
        $problemType,
        $problemMessage)
    {
        if (!is_string($definitionSource) || !is_string($problemMessage)) {
            throw new LazyJsonMapperException('The definitionSource and problemMessage parameters must be strings.');
        }
        if ($problemType !== 'bad_definitions' && $problemType !== 'missing_definitions') {
            throw new LazyJsonMapperException('The problemType parameter must be either "bad_definitions" or "missing_definitions".');
        }

        if (!isset($this->{$problemType}[$definitionSource])) {
            $this->{$problemType}[$definitionSource] = [];
        }

        $this->{$problemType}[$definitionSource][] = $problemMessage;
    }
public function addProblem(
        $definitionSource,
        $problemType,
        $problemMessage)
    {
        if (!is_string($definitionSource) || !is_string($problemMessage)) {
            throw new LazyJsonMapperException('The definitionSource and problemMessage parameters must be strings.');
        }
        if ($problemType !== 'bad_definitions' && $problemType !== 'missing_definitions') {
            throw new LazyJsonMapperException('The problemType parameter must be either "bad_definitions" or "missing_definitions".');
        }

        if (!isset($this->{$problemType}[$definitionSource])) {
            $this->{$problemType}[$definitionSource] = [];
        }

        $this->{$problemType}[$definitionSource][] = $problemMessage;
    }
public function addProblem ( $ definitionSource , $ problemType , $ problemMessage ) { if ( ! is_string ( $ definitionSource ) || ! is_string ( $ problemMessage ) ) { throw new LazyJsonMapperException ( 'The definitionSource and problemMessage parameters must be strings.' ) ; } if ( $ problemType !== 'bad_definitions' && $ problemType !== 'missing_definitions' ) { throw new LazyJsonMapperException ( 'The problemType parameter must be either "bad_definitions" or "missing_definitions".' ) ; } if ( ! isset ( $ this -> { $ problemType } [ $ definitionSource ] ) ) { $ this -> { $ problemType } [ $ definitionSource ] = [ ] ; } $ this -> { $ problemType } [ $ definitionSource ] [ ] = $ problemMessage ; }
Adds a problem description to the internal state.

@param string $definitionSource The class which has the problem.
@param string $problemType      Type of problem. Either `bad_definitions`
or `missing_definitions`.
@param string $problemMessage   A message describing the actual problem.

@throws LazyJsonMapperException If any of the parameters are invalid.

@see ClassAnalysis::hasProblems()
Adds a problem description to the internal state .