Skip to content

Commit

Permalink
Using ICanBoogie/Inflector in place of Inflect.php
Browse files Browse the repository at this point in the history
  • Loading branch information
enobrev committed Aug 25, 2020
1 parent 426ebcc commit 0bb2801
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 204 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"php": ">=7.2",
"ext-json": "*",
"adbario/php-dot-notation": "~2.2",
"icanboogie/inflector": "^2.0",
"laminas/laminas-diactoros": "^2.2",
"laminas/laminas-httphandlerrunner": "^1.1",
"monolog/monolog": "^2.0"
Expand Down
55 changes: 54 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

200 changes: 0 additions & 200 deletions src/Inflect.php

This file was deleted.

6 changes: 4 additions & 2 deletions src/Strings.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
<?php
namespace Enobrev;

use ICanBoogie\Inflector;

/**
* @param string $sWord
* @return string
*/
function depluralize(string $sWord) : string {
return Inflect::singularize($sWord);
return Inflector::get()->singularize($sWord);
}

/**
* @param string $sWord
* @return string
*/
function pluralize(string $sWord): string {
return Inflect::pluralize($sWord);
return Inflector::get()->pluralize($sWord);
}
2 changes: 1 addition & 1 deletion tests/DepluralizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function setUp():void {
'geese' => 'goose',
'languages' => 'language',
'media' => 'medium',
'mooses' => 'moose',
'moose' => 'moose',
'prices' => 'price',
'processings' => 'processing',
'states' => 'state',
Expand Down

0 comments on commit 0bb2801

Please sign in to comment.