HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/hours.komma.pro/app/Komma/Excel/Types/Row/AbstractTypeRow.php
<?php


namespace App\Komma\Excel\Types\Row;


abstract class AbstractTypeRow
{

    /**
     * Get the attributes of the excel row
     *
     * @return array
     */
    public static function getAttributes(): array
    {
        return array_keys(get_class_vars(static::class));
    }

    /**
     * Get the value of the row
     *
     * @param  string  $attribute
     * @return mixed
     */
    public function getValue(string $attribute)
    {
        switch ($attribute) {
            case 'date':
                return $this->{$attribute}->format('d-m-Y');

            case 'user':
                return $this->{$attribute}->name;

            case 'billable':
            case 'billed':
            case 'bug':
                return $this->{$attribute} ? 'Ja' : 'Nee';

            default:
                return $this->{$attribute};
        }
    }

    abstract function hasStyling() :bool;
}