PHPackages                             fandeco/category - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. fandeco/category

ActiveProject

fandeco/category
================

1.0.0(3y ago)02.5k↓41.7%PHPPHP &gt;=7.0

Since Jun 29Pushed 7mo ago4 watchersCompare

[ Source](https://github.com/fandeco/Category)[ Packagist](https://packagist.org/packages/fandeco/category)[ RSS](/packages/fandeco-category/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Единый класс категорий
======================

[](#единый-класс-категорий)

Клас проверки категорий согласно документу ниже

[Проект по новым категориям](https://docs.google.com/spreadsheets/d/1tKIDh4Lo4LjGdXGw5-UzO8ZCRkCDkNYMw4wjB3sU7MM/edit#gid=33988330)

подключение
-----------

[](#подключение)

```
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/fandeco/Category"
    }
  ],
  "require": {
    "fandeco/category": "dev-master"
  }
}
```

Использование
-------------

[](#использование)

### Category

[](#category)

```
require_once "vendor/autoload.php";

use fandeco\category\Category;
use fandeco\category\CategoryExtension;

$categoryValidator = new Category();

try {
// Возвращает правильные категорию и под категорию. Используйте только ети значения, а не те что переданы в аргументы
	[$validCategory,$validSubCategory] = $categoryValidator->validate("test", "test2");

} catch (CategoryExtension $e) {
	echo $e->getMessage().'; '.	$e->getCategory().'; '.	$e->getSubCategory()
}
//Возвращает данные о категории
$categoryValidator->getDataByCategory("Люстры","Потолочные люстры") //
//[
//	'category'    => 'Люстры',
//	'subCategory' => 'Потолочные люстры',
//	'singular'    => 'Потолочная люстра',
//	'template'    => 'Потолочная люстра {$vendor} {$collection} {$article}',
//]

// Возвращает порядковый номер категории
$categoryValidator->getOrderByCategory("Люстры") // 1

// Возвращает имя файла по артикулу заменяя все спец символы на ~ по регламенту
Category::getFileNameFromArticle('6053/17 AP-1'); //6053~17 AP-1
```

### Description

[](#description)

```
$description = new Description($items);
$description->add($item)
$description->gen()
$description->descriptions //  массив с готовыми описаниями [[articul] =>'discription']
$description->disc_without_html // массив описаний ключ - артикул 1с значение описание с html
$description->Json // Массив описания для seo и иных шаблонов

//-------
$description = new Description();
[$result, $raw, $disc] = $description->description($item)// возвращает массив описаний для $item [$result, $raw, $disc]
$result// описание с html
$raw// описание без html
$disc//  Массив описания для seo и иных шаблонов
```

ПРОЦЕСС ОБНОВЛЕНИЯ
==================

[](#процесс-обновления)

```
composer up:build
```

1. ~~ скачать [Проект по новым категориям](https://docs.google.com/spreadsheets/d/1tKIDh4Lo4LjGdXGw5-UzO8ZCRkCDkNYMw4wjB3sU7MM/edit#gid=33988330)в формате `xlsx`~~
2. положить в папу с проектом
3. открыть файл `src/parcer.php` и изменить путь до файла в константе `InputFileName`
4. запустить скрипт `src/parcer.php`
5. запустить тесты, если тесты пройдены git push, и в проектах composer update

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance45

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/258daf0924571b74f805d1928446978bc93dd75265197ae9ac7dac47c70ddd83?d=identicon)[Traineratwot](/maintainers/Traineratwot)

---

Top Contributors

[![Traineratwot](https://avatars.githubusercontent.com/u/41589091?v=4)](https://github.com/Traineratwot "Traineratwot (75 commits)")[![parolax](https://avatars.githubusercontent.com/u/48834772?v=4)](https://github.com/parolax "parolax (7 commits)")[![webnitros](https://avatars.githubusercontent.com/u/5019138?v=4)](https://github.com/webnitros "webnitros (3 commits)")[![dimitriytiho](https://avatars.githubusercontent.com/u/31882469?v=4)](https://github.com/dimitriytiho "dimitriytiho (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fandeco-category/health.svg)

```
[![Health](https://phpackages.com/badges/fandeco-category/health.svg)](https://phpackages.com/packages/fandeco-category)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
