You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: MFormatter.m
    path of file: ./repos/MBeautifier/+MBeautifier
    
    the code of the file until where you have to start completion: classdef MFormatter < handle
    % Performs the actual code formatting. Should not be used directly but only by MBeautify.

    properties (Access = private)
    
function formattedSource = performFormatting(obj, source)
            % Performs formatting on the specified source.

            obj.BlockCommentDepth = 0;
            obj.IsInBlockComment = false;
            obj.DirectiveDirector = MBeautifier.DirectiveDirector();

            nMaximalNewLines = obj.Configuration.specialRule('MaximalNewLines').ValueAsDouble;
            nSectionPrecedingNewlines = obj.Configuration.specialRule('SectionPrecedingNewlineCount').ValueAsDouble;
            formatSectionPrecedingNewlines = nSectionPrecedingNewlines >= 0;
            nSectionTrailingNewlines = obj.Configuration.specialRule('SectionTrailingNewlineCount').ValueAsDouble;
            formatSectionTrailingNewlines = nSectionTrailingNewlines >= 0;
            newLine = MBeautifier.Constants.NewLine;

            contTokenStruct = MBeautifier.MFormatter.TokenStruct.ContinueToken;
            textArray = regexp(source, newLine, 'split');

            replacedTextArray = {};
            isInContinousLine = 0;
            containerDepth = 0;
            contLineArray = cell(0, 2);
            isSectionSeparator = false;

            isFormattingOff = false;

            nNewLinesFound = 0;
            for j = 1:numel(textArray)
                line = textArray{j};

                %% Check for directives if ...
                % ... NOT in continous line
                % ... NOT in block comment
                if ~isInContinousLine && ~obj.IsInBlockComment
                    directiveChange = obj.DirectiveDirector.updateFromLine(line);
                    if ~isequal(directiveChange.Type, MBeautifier.DirectiveChangeType.NONE)
                        switch (lower(directiveChange.DirectiveName))
                            case 'format'
                                if isequal(directiveChange.Type, MBeautifier.DirectiveChangeType.REMOVED)
                                    isFormattingOff = false;
                                elseif isequal(directiveChange.Type, MBeautifier.DirectiveChangeType.ADDED) || isequal(directiveChange.Type, MBeautifier.DirectiveChangeType.CHANGED)
                                    isFormattingOff = numel(directiveChange.Directive.Values) > 0 && strcmpi(directiveChange.Directive.Values{1}, 'off');
                                end