Skip to content

Commit

Permalink
Add PSR-4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nazbav committed Dec 28, 2023
1 parent 3feeb5b commit ac7a8c2
Show file tree
Hide file tree
Showing 15 changed files with 435 additions and 606 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

vendor/
.idea/
2 changes: 2 additions & 0 deletions Library/NCL/NCL.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
namespace seagullua\NameCaseLib\NCL;

/**
* @license Dual licensed under the MIT or GPL Version 2 licenses.
* @package NameCaseLib
Expand Down
9 changes: 1 addition & 8 deletions Library/NCL/NCLNameCaseCore.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace seagullua\NameCaseLib\NCL;

/**
* @license Dual licensed under the MIT or GPL Version 2 licenses.
Expand All @@ -7,14 +8,6 @@
/**
*
*/
if (!defined('NCL_DIR'))
{
define('NCL_DIR', dirname(__FILE__));
}

require_once NCL_DIR . '/NCL.php';
require_once NCL_DIR . '/NCLStr.php';
require_once NCL_DIR . '/NCLNameCaseWord.php';

/**
* <b>NCL NameCase Core</b>
Expand Down
1 change: 1 addition & 0 deletions Library/NCL/NCLNameCaseWord.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace seagullua\NameCaseLib\NCL;
/**
* @license Dual licensed under the MIT or GPL Version 2 licenses.
* @package NameCaseLib
Expand Down
1 change: 1 addition & 0 deletions Library/NCL/NCLStr.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
namespace seagullua\NameCaseLib\NCL;
/**
* @license Dual licensed under the MIT or GPL Version 2 licenses.
* @package NameCaseLib
Expand Down
571 changes: 216 additions & 355 deletions Library/NCLNameCaseRu.php

Large diffs are not rendered by default.

392 changes: 154 additions & 238 deletions Library/NCLNameCaseUa.php

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ NameCaseLib — библиотека PHP5, предназначенная для
- Демонстрация работы - http://namecaselib.com/case/
- Документация - http://namecaselib.com/book/

## 0.4.2 (2023-12-28) (@nazbav)
- Delete includes
- Add PSR-4 support

## 0.4.1 (2016-11-23)
- Rules updates (5 years of work)
- Any pull requests with the new rules updates will be merged now
Expand Down
2 changes: 1 addition & 1 deletion Tests/Library/NCLNameCaseRuTestFatherboy.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/../../Library/NCL.NameCase.ru.php';
require_once dirname(__FILE__) . '/../../Library/NCLNameCaseRu.php';


class NCLNameCaseRuTest extends PHPUnit_Framework_TestCase
Expand Down
2 changes: 1 addition & 1 deletion Tests/Library/NCLNameCaseRuTestFathergirl.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/../../Library/NCL.NameCase.ru.php';
require_once dirname(__FILE__) . '/../../Library/NCLNameCaseRu.php';


class NCLNameCaseRuTest extends PHPUnit_Framework_TestCase
Expand Down
2 changes: 1 addition & 1 deletion Tests/Library/NCLNameCaseRuTestNamesgirl.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/../../Library/NCL.NameCase.ru.php';
require_once dirname(__FILE__) . '/../../Library/NCLNameCaseRu.php';


class NCLNameCaseRuTest extends PHPUnit_Framework_TestCase
Expand Down
2 changes: 1 addition & 1 deletion Tests/Library/NCLNameCaseRuTestSirnamesboy.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/../../Library/NCL.NameCase.ru.php';
require_once dirname(__FILE__) . '/../../Library/NCLNameCaseRu.php';


class NCLNameCaseRuTest extends PHPUnit_Framework_TestCase
Expand Down
2 changes: 1 addition & 1 deletion Tests/Library/NCLNameCaseRuTestSirnamesgirl.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once dirname(__FILE__) . '/../../Library/NCL.NameCase.ru.php';
require_once dirname(__FILE__) . '/../../Library/NCLNameCaseRu.php';


class NCLNameCaseRuTest extends PHPUnit_Framework_TestCase
Expand Down
23 changes: 23 additions & 0 deletions Tests/testPSR4.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php


use seagullua\NameCaseLib\NCLNameCaseRu;

header('Content-type: text/html; charset=utf-8');

/**
* Подключаем необходимый язык
*/
require '../vendor/autoload.php';
/**
* Создаем обьект класса.
* Теперь библиотека готова к работе
*/
$nc = new NCLNameCaseRu();
/**
* Производим склонения и выводим результат на экран
*/

print_r($nc->qSecondName("Иванов"));
print_r($nc->qFirstName("Андрей"));
print_r($nc->qFatherName("Алексеевич"));
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "nazbav/name-case-lib",
"description": "NameCaseLib — библиотека PHP5, предназначенная для автоматического склонения ФИО в русском и украинском языках. Уникальная особенность состоит в том, что библиотека содержит одинаковые методы для работы с ФИО на русском и украинском языках.",
"minimum-stability": "stable",
"license": "MIT",
"varsion": "0.4.2",
"authors": [
{
"name": "Andriy Chaika",
"email": "[email protected]"
},
{
"name": "Rabotyahoff",
"homepage": "https://github.com/Rabotyahoff"
}
],
"autoload": {
"psr-4": {
"seagullua\\NameCaseLib\\": "Library/"
}
},
"require": {
"php": ">=5.6"
}
}

0 comments on commit ac7a8c2

Please sign in to comment.