Anons79 Mini Shell

Directory : /home/aplikasiposinfo/www/hayyumart.com/vendor/kavist/rajaongkir/src/SearchDrivers/
Upload File :
Current File : /home/aplikasiposinfo/www/hayyumart.com/vendor/kavist/rajaongkir/src/SearchDrivers/BasicDriver.php

<?php

namespace Kavist\RajaOngkir\SearchDrivers;

class BasicDriver extends AbstractDriver
{
    /**
     * @param string $searchQuery
     * @return array
     */
    public function search(string $searchQuery): array
    {
        $rowColumn = array_column($this->collection, $this->searchColumn);
        $s = preg_replace('/(\s|$)/', '.+?$1', preg_quote($searchQuery, '/'));
        $res = preg_grep('/^'.$s.'/i', $rowColumn);
        $resKey = array_keys($res);
        foreach ($this->collection as $key => $val) {
            if (in_array($key, $resKey)) {
                $result[] = $val;
            }
        }

        return $result;
    }
}

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]