<?php

namespace HieuLe\BodyClasses;

class Body
{
    /**
     * Internal classes
     *
     * @var array
     */
    protected $classes = array();

    /**
     * Append new class
     *
     * @param string|array $classes
     */
    public function addClasses($classes)
    {
        if (!is_array($classes)) {
            $classes = array($classes);
        }

        foreach ($classes as $class) {
            $this->classes[] = $class;
        }

        $this->classes = array_unique($this->classes);
    }

    /**
     * Get all internal classes as a string
     *
     * @return string
     */
    public function getClasses()
    {
        return implode(' ', $this->classes);
    }

    /**
     * Get the internal class array
     *
     * @return array
     */
    public function getClassArray()
    {
        return $this->classes;
    }
}
<?php

namespace HieuLe\BodyClasses;

class Body
{
    /**
     * Internal classes
     *
     * @var array
     */
    protected $classes = [];

    /**
     * Append new class
     *
     * @param string|array $classes
     */
    public function addClasses($classes)
    {
        if (!is_array($classes)) {
            $classes = [$classes];
        }

        foreach ($classes as $class) {
            $this->classes[] = $class;
        }

        $this->classes = array_unique($this->classes);
    }

    /**
     * Get all internal classes as a string
     *
     * @return string
     */
    public function getClasses()
    {
        return implode(' ', $this->classes);
    }

    /**
     * Get the internal class array
     *
     * @return array
     */
    public function getClassArray()
    {
        return $this->classes;
    }
}
--- 
+++ 
@@ -9,7 +9,7 @@
      *
      * @var array
      */
-    protected $classes = [];
+    protected $classes = array();
 
     /**
      * Append new class
@@ -19,7 +19,7 @@
     public function addClasses($classes)
     {
         if (!is_array($classes)) {
-            $classes = [$classes];
+            $classes = array($classes);
         }
 
         foreach ($classes as $class) {
Replace short array syntax to compatible with PHP 5.3
