protected function setOptions(array $options)
    {
        // @codeCoverageIgnoreStart
        $this->parserDefaults = array_merge($this->parserDefaults, [
            // The import callback ensures that if a file is not found in the
            // app's webroot, it will search for that file in its plugin's
            // webroot path
            'import_callback' => function ($lessTree) {
                if ($pathAndUri = $lessTree->PathAndUri()) {
                    return $pathAndUri;
                }

                $file = $lessTree->getPath();
                list($plugin, $basefile) = $this->assetSplit($file);
                $file = $this->pluginAssetFile([$plugin, $basefile]);

                if ($file) {
                    return [
                        $file,
                        $this->assetBaseUrl($plugin, $basefile)
                    ];
                }

                return null;
            }
        ]);
        // @codeCoverageIgnoreEnd

        if (empty($options['parser'])) {
            $options['parser'] = [];
        }
        if (Configure::read('debug') && !isset($options['parser']['sourceMap'])) {
            $options['parser']['sourceMap'] = true;
        }
        $options['parser'] = array_merge($this->parserDefaults, $options['parser']);

        if (empty($options['js'])) {
            $options['js'] = [];
        }
        $options['js'] = array_merge($this->lessjsDefaults, $options['js']);

        if (empty($options['less'])) {
            $options['less'] = 'Less.less.min';
        }

        if (!isset($options['cache'])) {
            $options['cache'] = true;
        }

        return $options;
    }