Sha256: d8250bf158936790254349b5d7b077831975299270fcbb6b30adf6f276ad696d

Contents?: true

Size: 695 Bytes

Versions: 10

Compression:

Stored size: 695 Bytes

Contents

<?php

namespace MtHaml\Indentation;

class Undefined implements IndentationInterface
{
    public function newLevel($indent)
    {
        if (0 == strlen($indent)) {
            return $this;
        } else {
            return Indentation::oneLevel($indent);
        }
    }

    public function getChar()
    {
        return null;
    }

    public function getWidth()
    {
        return null;
    }

    public function getLevel()
    {
        return 0;
    }

    public function getString($levelOffset = 0, $fallback = null)
    {
        $char = substr($fallback, 0, 1);
        if (' ' === $char || "\t" === $char) {
            return $char;
        }

        return '';
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.3.1 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.3.0 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.2.5 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.2.4 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.2.3 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.2.2 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.2.1 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.2.0 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php
guard-mthaml-0.1.0 vendor/mthaml/mthaml/lib/MtHaml/Indentation/Undefined.php