承接 nayjest/tree 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nayjest/tree

最新稳定版本:v3.2.1

Composer 安装命令:

composer require nayjest/tree

包简介

Tree data structure for PHP

README 文档

README

Tree data structure for PHP

Build Status Scrutinizer Code Quality Latest Stable Version

Requirements

  • php 5.4+

Installation

The recommended way of installing the component is through Composer.

Run following command:

composer require nayjest/tree

Overview

Tree Nodes

Nodes are basic tree elements. This package represents tree nodes as instances of Nayjest\Tree\Node. Since nodes here don't holds any functionality beyond the scope of organizing into a trees, the package is designed for extending its components functionality in different ways:

  • Extend base classes (Node, ReadonlyNode)
  • Provide your own implementations of ParentNodeInterface and ChildNodeInterface
  • Use traits (NodeTrait, ChildNodeTrait, ParentNodeTrait, ReadonlyNodeTrait) and interfaces if you can't use node classes as base classes

Node Collections

Each node stores its children inside instance of Nayjest\Tree\NodeCollection.

This package uses nayjest/collections for working with collections.

Class Nayjest\Tree\NodeCollection provides consistency of parent-child node relations.

It means that if you will add node to collection, this node will be automatically attached to parent node associated with collection, if you will remove node from collection, node will be detached from parent node.

Trees

Class Nayjest\Tree\Tree allows to:

  • organize trees with named nodes (nodes itself don't store information about its name, class Tree works with any objects that implements NodeInterface)
  • build tree based on hierarchy configuration (multidimantional array containing only node names) and registry of nodes(associative array where keys are names and values are nodes)
  • manipulate named nodes in convenient way (Tree API)
  • protect tree structure from modifying via Node API methods to avoid inconsistency of node relations.

Nayjest\Tree\Utils

This class is a facade for helper functions.

Testing

Run following command:

phpunit

License

© 2014—2016 Vitalii Stepanenko

Licensed under the MIT License.

Please see License File for more information.

统计信息

  • 总下载量: 97.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 3
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固