Check if the string is a directory.

@param $item

@return bool
328370
public function isAllowedDirectory($item)
    {
        return
            is_dir($item) &&
            !ends_with($item, DIRECTORY_SEPARATOR.'.') &&
            !ends_with($item, DIRECTORY_SEPARATOR.'..');
    }
720933
public function checkHasSettings($item)
    {
        $plugin = Eresus_Plugin_Registry::getInstance()->load($item['name']);
        if (false === $plugin)
        {
            return false;
        }
        $provider = new Eresus_Admin_ContentProvider_Plugin($plugin);
        return false !== $provider->getSettingsController();
    }
1091217
public function hasItem(Item $item, bool $initialOnly = true): bool
    {
        $list = ($initialOnly) ? $this->initialItems : $this->items;
        foreach ($list as $my_item) {
            if (0 === Item::compare($my_item, $item)) {
                return true;
            }
        }
        return false;
    }
427057
protected function filter( string $item ): bool {

		foreach ( self::$skip as $match ) {
			if ( false !== strpos( $item, $match ) ) {
				return false;
			}
		}

		return true;
	}
1072165
private function __dir(string $dir) : bool
  {
    if (!is_dir($dir)) {
      mkdir($dir, 0777, true);
    }

    if (is_dir($dir)) return true;

    return false;
  }
1001074
public function saveData($item)
    {
        $attributes = $item->dataProperties->getAttributesForSave($item->id);
        if(empty($attributes)) return false;

        $classData = static::getClassData();

        foreach ($attributes as $slug => $values)
        {

            $classData::deleteAll(['item_id' => $item->id, 'property_slug' => $slug]);
            $values = (is_array($values)) ? $values : [$values];

            foreach ($values as $value){

                $value = (is_array($value)) ? array_values($value)[0] : $value;

                $data = new $classData;
                $data->value = $value;
                $data->property_slug = $slug;
                $data->item_id = $item->id;
                if(!empty($value)) $data->save();
            }
        }
    }
228966
public function isActive(Item $item)
    {
        // Check if one of the children is active
        foreach ($item->getItems() as $child) {
            if ($this->isActive($child)) {
                return true;
            }
        }

        // Custom set active path
        if ($path = $item->getActiveWhen()) {
            return Request::is(
                $path
            );
        }

        $path = ltrim(str_replace(url('/'), '', $item->getUrl()), '/');

        return Request::is(
            $path,
            $path . '/*'
        );
    }
501728
private function isAssocArray($item): bool
    {
        if (!is_array($item)) {
            // Is not an array at all
            return false;
        }

        if ($item === []) {
            // Treat empty array as Sequential
            return false;
        }

        // Check if keys are equal to sequence of 0 .. n-1
        return array_keys($item) !== range(0, count($item) - 1);
    }
336377
protected function isItemActive($item)
	{
		if (!isset($item['url'])) return false;

		if (is_callable($this->isActiveCallback)) {
			return call_user_func($this->isActiveCallback, $item);
		} else {
			return \asinfotrack\yii2\toolbox\helpers\Url::isUrlActive($item['url']);
		}
	}
722760
private static function isSorted($item)
    {
        return
            (is_object($item) && null !== $item->getPosition())
            ||
            (is_array($item) && isset($item[static::POSITION_KEY]));
    }
1153323
protected function locate($item): ?ItemBucket
    {
        for ($this->rewind(); $this->valid(); $this->next()) {
            /** @var ItemBucket $current */
            $current = $this->current;
            if (Validate::areEqual($item, $current->item())) {
                return $current;
            }
        }

        return null;
    }
1155322
public function isParentOf(Geo $item){
        return ($this->left < $item->left) && ($this->right > $item->right) && ($this->depth == $item->depth-1);
    }
690417
public function filter_output($item)
    {
        // filter out item if the name is not in "excluded" list
        if(!$this->is_allowed_name($item["attributes"]["name"], $item["type"] === self::TYPE_FOLDER)) {
            return false;
        }

        // filter out item if any filter is specified and item is matched
        $filter_name = isset($this->refParams['type']) ? $this->refParams['type'] : null;
        $allowed_types = isset($this->config['outputFilter'][$filter_name]) ? $this->config['outputFilter'][$filter_name] : null;
        if($filter_name && is_array($allowed_types) && $item["type"] === self::TYPE_FILE) {
            return (in_array(strtolower($item["attributes"]["extension"]), $allowed_types));
        }

        return true;
    }
14582
public static function isDir($path)
    {
        return (self::isPhar($path) === true) ? file_exists($path) : is_dir($path);
    }
82817
public static function rmDir($dir)
    {
        if (!file_exists($dir)) {
            return true;
        }
        if (!is_dir($dir)) {
            return unlink($dir);
        }
        foreach (scandir($dir) as $item) {
            if ($item == '.' || $item == '..') {
                continue;
            }
            if (!Paths::rmDir($dir . DIRECTORY_SEPARATOR . $item)) {
                return false;
            }

        }
        return rmdir($dir);
    }
230166
public function push($item): bool {
        if (!$this->isValid()) return false;

        $this->stack[$this->size] = $item;
        $this->size++;
        return true;
    }
235934
protected function isCorrectType($item)
    {
        if (is_null($this->type)) {
            return true;
        }

        if ($this->type !== 'object' && is_object($item)) {
            return $item instanceof $this->type;
        }

        return gettype($item) === $this->type;
    }